Skip to content

Commit 2691812

Browse files
authored
Revert "Add SnoopPrecompile (#1018)" (#1043)
This reverts commit 77578cc.
1 parent 09bc666 commit 2691812

File tree

3 files changed

+28
-4
lines changed

3 files changed

+28
-4
lines changed

Project.toml

+1-3
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,20 @@ Mmap = "a63ad114-7e13-5084-954f-fe012c677804"
1212
Parsers = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0"
1313
PooledArrays = "2dfb63ee-cc39-5dd5-95bd-886bf059d720"
1414
SentinelArrays = "91c51154-3ec4-41a3-a24f-3f23e20d615c"
15-
SnoopPrecompile = "66db9d55-30c0-4569-8b51-7e840670fc0c"
1615
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
1716
Unicode = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
1817
WeakRefStrings = "ea10d353-3f73-51f8-a26c-33c1cb351aa5"
1918

2019
[compat]
2120
CodecZlib = "0.7"
22-
FilePathsBase = "0.6,0.7,0.8,0.9"
2321
InlineStrings = "1"
22+
FilePathsBase = "0.6,0.7,0.8,0.9"
2423
Parsers = "2.2.4"
2524
PooledArrays = "0.5, 1.0"
2625
SentinelArrays = "1.2"
2726
Tables = "1.1"
2827
WeakRefStrings = "1.4"
2928
julia = "1.6"
30-
SnoopPrecompile = "1"
3129

3230
[extras]
3331
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"

precompile.jl

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# generates precompile.jl files
2+
using CSV, Parsers, SentinelArrays, SnoopCompile
3+
4+
const dir = joinpath(dirname(pathof(CSV)), "..", "test", "testfiles")
5+
6+
timings = @snoopi tmin=0.001 begin
7+
8+
f = CSV.File(joinpath(dir, "precompile.csv"))
9+
f = CSV.File(joinpath(dir, "precompile_small.csv"))
10+
11+
end # @snoopi
12+
13+
pc = SnoopCompile.parcel(timings)
14+
precom = joinpath(dirname(pathof(CSV)), "..", "precompile")
15+
SnoopCompile.write(precom, pc)
16+
mv(joinpath(precom, "precompile_CSV.jl"), joinpath(dirname(pathof(CSV)), "precompile.jl"); force=true)
17+
mv(joinpath(precom, "precompile_Parsers.jl"), joinpath(dirname(pathof(Parsers)), "precompile.jl"); force=true)
18+
mv(joinpath(precom, "precompile_SentinelArrays.jl"), joinpath(dirname(pathof(SentinelArrays)), "precompile.jl"); force=true)

src/CSV.jl

+9-1
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,14 @@ function read(source, sink=nothing; copycols::Bool=false, kwargs...)
115115
Tables.CopiedColumns(CSV.File(source; kwargs...)) |> sink
116116
end
117117

118-
include("workload.jl")
118+
include("precompile.jl")
119+
_precompile_()
120+
121+
function __init__()
122+
CSV.Context(IOBuffer(CSV.PRECOMPILE_DATA))
123+
# CSV.File(IOBuffer(CSV.PRECOMPILE_DATA))
124+
# foreach(row -> row, CSV.Rows(IOBuffer(PRECOMPILE_DATA)))
125+
# CSV.File(joinpath(dirname(pathof(CSV)), "..", "test", "testfiles", "promotions.csv"))
126+
end
119127

120128
end # module

0 commit comments

Comments
 (0)