-
-
Notifications
You must be signed in to change notification settings - Fork 922
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
[refactor] improve Date parsing performance #5259
Conversation
MRI has all of the date code in C and also avoids $~ and friends ... expected to noticeably improve Date.parse/_parse performance
str.match? always does 'real' Regexp#match? no matter of patches + also do not use same (throw away) array for different things
... now we can not blame $frame "globals" for being slow
this, actually, doesn't do that much (as @enebo's work) :
master
we're now at :
|
actually not much of a difference on GraalVM (-Xcompile.invokedynamic same results wout indy) :
PR branch :
|
this seems to make a difference - indy doesn't get better ... its ~ the same if the left-over .rb impl gets to use `subs()`
attempted to move a piece into native (^^ above commit), and it makes a difference :
indy doesn't improve - also tried keeping
graal
|
with indy on GraalVM we (almost) meet MRI 2.5 performance ... except `Date.parse('2018-07-17', false)` being 2x slower
gets us close to MRI performance -> pretty much resolves jrubyGH-5255 ... also added a b|B check (which MRI doesn;t have) for parse_bc
... regexp was slightly different in JRuby's format.rb
3x speed improvement for raw dates `Date._parse('2000-01-01')`
so this should be resolved, matching up with MRI's C got us to (indy ~ 5% slower) :
for reference MRI 2.5 :
|
... and with commit 4109d58 (additional checks for avoiding a regexp) we're now also good with raw dates:
DateTime's |
@enebo should be good to go, if you do not have any objections ... not planning more work atm |
as an attempt to speed-up #5255
... this gets slightly faster on HotSpot, still noticeably slower than MRI (which has these in C)
Graal might be in a better spot doing EA, since the frame writes aren't there ...