-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Changes in memory allocation as a consequence of package precompilation #34055
Labels
compiler:precompilation
Precompilation of modules
Comments
FYI, this may be related to the inlining. However, it is not clear which is the cause and which is the result. Also, it seems that the behavior differs between the precompilation triggered by |
quinnj
added a commit
to JuliaData/CSV.jl
that referenced
this issue
Aug 29, 2021
The changes in files that are not precompile.jl are inference improvements; mainly from inspecting results of `@code_typed`, Cthulhu.jl, and SnoopCompile.jl. The changes in precompile.jl are from comments from @timholy recommending that in our precompile process, we can just call regular code instead needing to call `precompile` with methods/arg types. I'm aware I don't understand all the details around precompilation, method invalidation, etc. but unfortunately, I feel a bit blocked with CSV.jl's precompilation. With the changes in #875, we now see a fixed overhead of allocations when parsing due, I'm told, to an issue in Base Julia (JuliaLang/julia#34055).
quinnj
added a commit
to JuliaData/CSV.jl
that referenced
this issue
Sep 1, 2021
* A little refactoring to improve inference and precompilation The changes in files that are not precompile.jl are inference improvements; mainly from inspecting results of `@code_typed`, Cthulhu.jl, and SnoopCompile.jl. The changes in precompile.jl are from comments from @timholy recommending that in our precompile process, we can just call regular code instead needing to call `precompile` with methods/arg types. I'm aware I don't understand all the details around precompilation, method invalidation, etc. but unfortunately, I feel a bit blocked with CSV.jl's precompilation. With the changes in #875, we now see a fixed overhead of allocations when parsing due, I'm told, to an issue in Base Julia (JuliaLang/julia#34055).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In JuliaGraphics/Colors.jl#370 it was noticed that adding
precompile
statements seems to have performance implications, and not always in a good way.Running
--track-allocation=all
with the statementsand then moving the
*.mem
files (inbase/
and all relevant packages) to/tmp/withpc
(with precompilation) and/tmp/nopc
(without precompilation) and running the following analysis script:yields a single relevant diff in
Colors/parse.jl
:It is not clear to me why this line should allocate memory in one case but not the other. One can also verify that commenting out the 3 precompile statements for
parse
from theteh/precompile
branch eliminates the extra allocation.The text was updated successfully, but these errors were encountered: