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
Invalidatorobjects on theRubyclass. The lookup of theInvalidatorobject 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:
✨