-
-
Notifications
You must be signed in to change notification settings - Fork 925
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
Examine the falcon backport patches for improvements we could apply to JRuby #412
Comments
@funny-falcon enumerated the patches separately here: https://gist.github.com/funny-falcon/4136519 There are five patches (the sixth combines 2 and 3):
|
st_opt contains one optimization that might be slightly worthwhile; specifically, it adds a separate "packed" hash entry struct that does not include insertion-ordered traversal fields. However, this would represent a savings in JRuby of only three reference fields (24 bytes at most, but usually less) and only for single-element hashes. I don't believe the optimization is worth it right now, and it really won't be if we get keyword arguments to be object-free in the future (since most single-element hashes will likely be from keyword args). |
ary_queue's main optimization appears to be using MEMMOVE to slide array contents around when there's nobody sharing the backing store. This does not really apply to JRuby, since any MEMMOVE equivalent will require at least a memory copy, and at worst a second array allocation. I will look to see if moving elements would be a valuable optimization for our push/shift impls. |
I believe it's not worth the more complicated metrics and special-case logic required to use copying to shift elements around without allocating a new array store. A heavy push/shift benchmark is also over 3x faster in JRuby right now. Closing, since none of these optimizations appear to apply to JRuby anymore. The load path optimization is known to be missing in JRuby and is tracked by other bugs. |
There are couple of alternative Hash implementations this spring https://bugs.ruby-lang.org/issues/12142 |
Several perf improvements from Ruby 2.0.0 have been backported to 1.9.3 by "falcon". They're enumerated here: https://gist.github.com/4136373
Some of these may be applicable to JRuby, such as Hash perf improvements and "Array as a queue" perf improvements. We should examine the list to see what we can duplicate.
The text was updated successfully, but these errors were encountered: