What are expected [pre]compile times?

I recently thought I’d try out the 1.5 release candidate when making some figures since rumor has it it’s quite snappy :slight_smile: I was surprised that on a fresh install, after Pkg.add("Gadfly"), using Gadfly took 149 seconds. 2.5 minutes seems like a lot for one package, albeit one with many dependencies?

But I realize I actually have no idea how long this should take. If you precompile a project and it takes N seconds, what heuristics do you use to determine if N is “woah, super fast,” “about as expected,” or “hmm, something’s wrong here?”

It’s only 2.5 minutes the first time though, after it is significantly faster, right?

It’s pretty hard to say. Typically the tradeoff is something like how useful the package is to you vs how long the compilation time is. For different people, that tradeoff might be different. Often, “fast” typically means that you compare to Julia at some other version where it was “slow”.

1 Like

In my experience it generally still takes ages.

What happens quite often in my workflow (which may be suboptimal), is that I have a package which several dependencies.
Then at some point I need to add an additional dependency (e.g. today I added Gumbo to the project below), which I think may update/downgrade some of the other dependencies underlying dependencies which in turn leads to relatively long precompilation times.

julia> Pkg.status()
Project HomeautomationK v0.1.0
Status `C:\Users\bernhard.konig\Documents\ASync\home\Code\Julia\HomeautomationK.jl\Project.toml`
  [336ed68f] CSV v0.6.2
  [a93c6f00] DataFrames v0.21.3
  [708ec375] Gumbo v0.8.0
  [4138dd39] JLD v0.10.0
  [682c06a0] JSON v0.21.0
  [39abe10b] MySQL v1.1.1
  [47be7bcc] ORCA v0.4.0
  [f0f68f2c] PlotlyJS v0.13.1
  [438e738f] PyCall v1.91.4
  [90137ffa] StaticArrays v0.12.3
  [2913bbd2] StatsBase v0.33.0
  [69024149] StringEncodings v0.3.1
  [f269a46b] TimeZones v1.2.0
  [ade2ca70] Dates

julia> @time begin
           Pkg.activate(pkgfldr);#;Pkg.resolve();Pkg.status() #;push!(LOAD_PATH,joinpath(pkgfldr,"src","HomeautomationK.jl"));
               using Unicode ;using MySQL;
           using HomeautomationK
               using CSV;using DataFrames;using StatsBase;using TimeZones;using JLD
 Activating environment at `C:\Users\bernhard.konig\Documents\ASync\home\Code\Julia\HomeautomationK.jl\Project.toml`
[ Info: Precompiling HomeautomationK [27fabfa0-e511-11e9-243a-af5d582a26de]
 WARNING: redefining constant known_mimetypes
WARNING: redefining constant singleton_instance
WARNING: redefining constant routing_callback
WARNING: redefining constant webio_server_config
57.319381 seconds (48.06 M allocations: 2.311 GiB, 2.20% gc time)

Yep, that 2.5 minutes includes precompilation. On a fresh 1.5 RC REPL in the same project, using Gadfly is 10.5 seconds for me.