-
Notifications
You must be signed in to change notification settings - Fork 103
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
Fix compilation and interpolation memory leaks #385
Conversation
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.
Looks fine, but I must admit I don't understand this code anymore.
It's confusing to need the function to always run at global scope, and requires some involved metaprogramming to get that right. Hopefully this is one step closer to a correct approach which is still backwards-compatible with the older versions. |
This is remarkably clever. Brava! |
Because @willow-ahrens fixed this leak in a non-breaking release of BenchmarkTools so it was apparently not unavoidable. (JuliaCI/BenchmarkTools.jl#385)
Because @willow-ahrens fixed this leak in a non-breaking release of BenchmarkTools so it was apparently not unavoidable. (JuliaCI/BenchmarkTools.jl#385)
Fixes #339. Fixes a memory leak in interpolated variables from
setup
andteardown
, continuing what was started in #265. Additionally, adds a cache of already-compiled sampler functions, so that wrapping a@benchmark
in a for-loop doesn't compile separate functions each iteration.Here's an example:
Setup
Main Branch
After Fixing Setup Leaks
After Fixing Redundant Compilation