-
-
Notifications
You must be signed in to change notification settings - Fork 399
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
Experimental: precompile functions #531
Conversation
Seems to help way more in global scope than in a function, not sure why. |
I'm pretty sure the printing code takes forever to compile; what happens if you precompile some of that? Or use |
Yeah printing takes forever, that was gonna my next challenge if this worked at all. To be clear, I was running that code as a script (with precompiled JuMP), so its not doing any printing (I also run with coverage to identity what was running). Most of the benefit came from the |
Base.precompile(buildrefsets, (Expr,)) | ||
# parseExpr_staged.jl | ||
Base.precompile(addToExpression_reorder, (AffExpr,(Int,Variable))) | ||
Base.precompile(addToExpression_reorder, (AffExpr,(Float64,Int))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are v0.4 only
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep
Cool, looks like it's helping a lot with the constraint |
@@ -1015,6 +1015,8 @@ include("callbacks.jl") | |||
include("print.jl") | |||
# Nonlinear-specific code | |||
include("nlp.jl") | |||
# Precompile functions to speed up initial runs | |||
include("precompile.jl") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Conditional include on VERSION > v"0.4-"
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we merge this, yeah
|
I was looking around and saw that PyCall was exploring similar ideas (JuliaPy/PyCall.jl#167) |
Closing in favour of #541 |
Test script: