Hello everybody! I’ve been learning Julia and I’ve been loving it!!
I’m curious about startup times…
I have this super simple code, but I’m baffled at how it take about 13 seconds to start! Also tested it on an i9 since 13s is on my apple m1, which seems like Julia is still not stable, and it took 18s there.
All the code is doing is reading a CSV file and nothing else. After googling the issue, it seems like it’s a known issue due to Julia compiling at startup.
I was wondering how can that be helped? Some places mentioned a --precompile flag that seems to be deprecated, other talk about sysimages…
Is there a Julia way to deal with this issue? I’ve also heard about a long running julia process and then using it interactively from there, but then how do I run a file after making code changes? would I need to worry about variables declared before? is there a julia client that when run it just send command to the long running julia process?
For reference, this is the code I’m running:
@time using CSV
@time using DataFrames
@time using Dates
dateformat = "yyyy-mm-dd HH:MM:SS"
types = [DateTime, Float64, Float64, Float64, Float64, Int64]
@time data = CSV.read("data.txt", DataFrame; dateformat = dateformat, types = types)
and I’m running it by calling
julia code.jl
and these are the times that I’m getting
1.911461 seconds (5.97 M allocations: 363.832 MiB, 5.30% gc time, 88.35% compilation time)
0.745739 seconds (1.82 M allocations: 124.596 MiB, 4.18% gc time)
0.001233 seconds (293 allocations: 28.188 KiB)
10.758393 seconds (39.59 M allocations: 1.697 GiB, 4.92% gc time, 99.87% compilation time)
Thanks a lot for your help!