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
Named based constant cache invalidation #798
Conversation
Mostly good suggestions from @wmeissner. Summing up some points:
We can attempt to make these changes for you, or if you like you can try them yourself. They're not major, and the patch looks good otherwise. |
@wmeissner @headius Thanks for the fantastic feedback! I've gone ahead and implemented your suggestions, also I've removed the synchronization from the |
Looks good! I'll get this merged and play with it a bit. One note about the benchmark: We don't handle caching Colon2 as well as we could, so there could be considerably more improvement if we did that. Your improvement here could make the entire :: chain optimize away to nothing and never invalidate...so that's motivation for me to make another attempt. |
Merged in 79dad3e. Thanks! Will have to try improving the perf of Colon2 logic in the compiler now. |
Hi!
I've implemented named based constant cache invalidation in JRuby.
In my implementation, I've added a hashtable mapping constant names to
Invalidator
objects on theRuby
class. The lookup of theInvalidator
object is cached in fields of certain classes (example) - I've tried to make this threadsafe, but I'd like my approach verified because I've probably made a mistake somewhere.I used this script to benchmark the performance improvement of this patch:
ruby-2.0.0-p0:
JRuby master:
JRuby constant-name-cache:
✨