-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
include
adds a significant amount of precompilation + loadtime
#37033
Comments
Are these literally module WithInclude
include("empty_file.jl")
end and module WithoutInclude
end ? |
~/JuliaTests
❯ cat WithInclude/src/WithInclude.jl
module WithInclude
greet() = print("Hello World!")
include("empty_file.jl") # this is an empty file
end # module
~/JuliaTests
❯ cat WithoutInclude/src/WithoutInclude.jl
module WithoutInclude
greet() = print("Hello World!")
end # module I update the first post with this. |
It seems to pretty well saturate at one Before these have been precompiled ( tim@diva:/tmp/pkgs$ julians -e 'push!(LOAD_PATH, "."); @time using WithInclude0'
0.241857 seconds (92.04 k allocations: 5.425 MiB)
tim@diva:/tmp/pkgs$ julians -e 'push!(LOAD_PATH, "."); @time using WithInclude'
0.295327 seconds (110.41 k allocations: 7.336 MiB)
tim@diva:/tmp/pkgs$ julians -e 'push!(LOAD_PATH, "."); @time using WithInclude2'
0.299110 seconds (110.55 k allocations: 7.345 MiB) and after compilation tim@diva:/tmp/pkgs$ julians -e 'push!(LOAD_PATH, "."); @time using WithInclude0'
0.000974 seconds (4.31 k allocations: 256.844 KiB)
tim@diva:/tmp/pkgs$ julians -e 'push!(LOAD_PATH, "."); @time using WithInclude'
0.014208 seconds (22.70 k allocations: 2.351 MiB)
tim@diva:/tmp/pkgs$ julians -e 'push!(LOAD_PATH, "."); @time using WithInclude2'
0.014501 seconds (22.84 k allocations: 2.361 MiB) |
Yeah, I didn't mean to give the impression that it scaled linearly or something like that. But with jll packages that are small and there's quite many of them, even these 0.015s per package adds up. |
File change detection? |
We're pretty sure it's just all backedges, so having more |
Assuming this was from JLL modules, might be worthwhile using |
Here's a profile with no
and here's one with:
|
So the breakdown is roughly:
|
This was noticed by @staticfloat, I just open an issue so it doesn't get forgotten.
I created two packages, the only difference is that one includes an empty file. The exact content is
Note the difference in precompilation time and load time:
Also, note the difference in file size:
@JeffBezanson suggests adding an inference barrier to cut the backedges to the module specific
include
.The text was updated successfully, but these errors were encountered: