Skip to content

Commit

Permalink
Revert "Add SnoopPrecompile (#1018)"
Browse files Browse the repository at this point in the history
This reverts commit 77578cc.
  • Loading branch information
quinnj committed Oct 22, 2022
1 parent 09bc666 commit 4463a56
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
4 changes: 1 addition & 3 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,20 @@ Mmap = "a63ad114-7e13-5084-954f-fe012c677804"
Parsers = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0"
PooledArrays = "2dfb63ee-cc39-5dd5-95bd-886bf059d720"
SentinelArrays = "91c51154-3ec4-41a3-a24f-3f23e20d615c"
SnoopPrecompile = "66db9d55-30c0-4569-8b51-7e840670fc0c"
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
Unicode = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
WeakRefStrings = "ea10d353-3f73-51f8-a26c-33c1cb351aa5"

[compat]
CodecZlib = "0.7"
FilePathsBase = "0.6,0.7,0.8,0.9"
InlineStrings = "1"
FilePathsBase = "0.6,0.7,0.8,0.9"
Parsers = "2.2.4"
PooledArrays = "0.5, 1.0"
SentinelArrays = "1.2"
Tables = "1.1"
WeakRefStrings = "1.4"
julia = "1.6"
SnoopPrecompile = "1"

[extras]
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Expand Down
18 changes: 18 additions & 0 deletions precompile.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# generates precompile.jl files
using CSV, Parsers, SentinelArrays, SnoopCompile

const dir = joinpath(dirname(pathof(CSV)), "..", "test", "testfiles")

timings = @snoopi tmin=0.001 begin

f = CSV.File(joinpath(dir, "precompile.csv"))
f = CSV.File(joinpath(dir, "precompile_small.csv"))

end # @snoopi

pc = SnoopCompile.parcel(timings)
precom = joinpath(dirname(pathof(CSV)), "..", "precompile")
SnoopCompile.write(precom, pc)
mv(joinpath(precom, "precompile_CSV.jl"), joinpath(dirname(pathof(CSV)), "precompile.jl"); force=true)
mv(joinpath(precom, "precompile_Parsers.jl"), joinpath(dirname(pathof(Parsers)), "precompile.jl"); force=true)
mv(joinpath(precom, "precompile_SentinelArrays.jl"), joinpath(dirname(pathof(SentinelArrays)), "precompile.jl"); force=true)
10 changes: 9 additions & 1 deletion src/CSV.jl
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,14 @@ function read(source, sink=nothing; copycols::Bool=false, kwargs...)
Tables.CopiedColumns(CSV.File(source; kwargs...)) |> sink
end

include("workload.jl")
include("precompile.jl")
_precompile_()

function __init__()
CSV.Context(IOBuffer(CSV.PRECOMPILE_DATA))
# CSV.File(IOBuffer(CSV.PRECOMPILE_DATA))
# foreach(row -> row, CSV.Rows(IOBuffer(PRECOMPILE_DATA)))
# CSV.File(joinpath(dirname(pathof(CSV)), "..", "test", "testfiles", "promotions.csv"))
end

end # module

0 comments on commit 4463a56

Please sign in to comment.