Conversation
|
Jeff added this new trick to Plots.jl already, helping make startup/first plot faster for Julia 1.5 (there MIGHT be a slowdown), so I copied that code. It's also been added to PyCall.jl so I've suggested elsewhere, where you see the reasoning: I didn't test here, and see you have JNI module where this may also apply for. |
|
Hi @PallHaraldsson , thank you for suggesting this. I'm looking into it. |
|
Reference: JuliaLang/julia#34896 |
|
I think this need to be benchmarked carefully. Since this is an experimental feature, I think we should merge but only enable this based on an environmental variable. In other words, it should not be active by default. |
|
Others are not that cautious (with environment variable), i.e. PyCall.jl. I'm not sure I would read too much into the "experimental". The assumption in PyCall is that you call code that does non-small amount of work. If you have extremely small amount of work being called, say in a loop, then it might be a problem, and I would look into such. I would just document this in NEWS, if you're worried. People could always revert to Julia 1.4 (and/or older version of JavaCall) if a problem. And if we hear of a problem the PR could be reverted. If you're really worried, just skip this PR. Maybe the startup isn't too bad (the only thing this helps, while for all packages adds up): |
|
My current analysis of the practical usage of this is that it saves a second during precompilation. After precompilation there is not much difference. |
|
This is after precompilation, I get 0.73 sec. faster with |
|
My current testing procedure is to evaluate the timing of running the tests ( My current results concur with setting O1. I am going to work on documenting that perhaps as a permanent tracking branch. I've used the following preamble to assist with the testing. |
|
Ok, I misunderstood you then. If, as you tested for actual code, after using, it's as fast, I would just go with -O1 as a default. I understand you being careful, and as I've proposed having the selective capability of module optimization in the hands of the user of the module, I (partially) support what you are doing. You could do an major version update, to v0.8, to signal to users a change and/or document in NEWS. I would then do it carefully, as people may consider higher opt faster, e.g. 3, while likely 0 (or 1) is always fastest. I see Plots.jl merged this in minor version 1.04. https://github.com/JuliaPlots/Plots.jl/blob/v1.0.4/src/Plots.jl not mentioning in NEWS. PyCall actually just merged the change silently too, but it's not yet in any tagged version, only on master. I would consider doing so, and people (who use master) could see what's it like. I don't see any reason for the precompile logic, it's irrelevant to this, and would only slow down, shouldn't be in the hands of users. There's no reason do add it since it works without. |
|
To be clear about the above code I just posted, it is for diagnostics only. It is not meant to be merged into the master branch or a release. I plan to keep that code on a parallel branch to measure performance with and without precompilation at each of the opt levels. |
|
@optlevel 1 seems to be optimal. |
No description provided.