Skip to content
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

add per-module optimization level #34896

Merged
merged 1 commit into from
Apr 6, 2020
Merged

add per-module optimization level #34896

merged 1 commit into from
Apr 6, 2020

Conversation

JeffBezanson
Copy link
Sponsor Member

Time for display(plot(rand(10))) on Plots master, baseline:

 25.938760 seconds (18.25 M allocations: 899.022 MiB, 1.74% gc time)

On this branch, adding Base.@optlevel 0 to Plots.jl:

 20.341163 seconds (18.26 M allocations: 899.217 MiB, 2.30% gc time)

@JeffBezanson JeffBezanson added compiler:codegen Generation of LLVM IR and native code compiler:latency Compiler latency labels Feb 26, 2020
@vtjnash
Copy link
Sponsor Member

vtjnash commented Feb 27, 2020

It might be better to map this directly to LLVM's optnone function attribute on the containing function itself, so that we don't have to inject the extra global state into the JIT. But otherwise, that's an impressive speedup!

@JeffBezanson JeffBezanson changed the title WIP: add per-module optimization level add per-module optimization level Apr 2, 2020
@JeffBezanson
Copy link
Sponsor Member Author

Ready for review.

Now that we have #35157, this should be able to work without affecting other functions that happen to be in the same llvm module.

@JeffBezanson JeffBezanson added the needs news A NEWS entry is required for this change label Apr 2, 2020
Copy link
Sponsor Member

@vtjnash vtjnash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have new numbers for this?

src/jitlayers.cpp Outdated Show resolved Hide resolved
@JeffBezanson
Copy link
Sponsor Member Author

With this, setting @optlevel 1 in Plots.jl takes the time from 18.5 sec to 13.5 sec.

@JeffBezanson JeffBezanson removed the needs news A NEWS entry is required for this change label Apr 3, 2020
@JeffBezanson
Copy link
Sponsor Member Author

Ok I think this is ready to go.

src/jitlayers.cpp Outdated Show resolved Hide resolved
@JeffBezanson JeffBezanson merged commit 78e4c2d into master Apr 6, 2020
@JeffBezanson JeffBezanson deleted the jb/permoduleopt branch April 6, 2020 17:28
@chriselrod
Copy link
Contributor

chriselrod commented Apr 8, 2020

I think this PR caused #35393 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:codegen Generation of LLVM IR and native code compiler:latency Compiler latency
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants