Skip to content
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

redo date.rb (most) parts in native #5076

merged 78 commits into from Mar 12, 2018

redo date.rb (most) parts in native #5076

merged 78 commits into from Mar 12, 2018


Copy link

@kares kares commented Mar 2, 2018

still using JODA but all of the JI stuff in date.rb is gone behind ext classes, motivation :

  • for a while its 'hard' to create Date instances in AR-JDBC
  • some near era conversion had a nasty bug in all 9K which constantly pops up in AR-JDBC
  • some isolated AR benchmarks showed its slower than MRI
  • there's going to be some nice JI bonuses - toJava working as with RubyTime etc.

some parts were already in native (formatting) so the base setup was already there.

NOTE: in MRI pretty much all of the date.rb is in native - so there's still space for improvement.
e.g. _parse would make sense to end up in .java maybe someone will attempt it afterwards.

p.s. left behind one minor suite failure (argument validation hour: 24+1.to_r/2)
while its simple the bigger picture (of MRI argument handling) feels a bit weird.
some parts handle the overflow some not, smt Float do not work while Rational is ok - clunky.
would eventually circle back as I feel like that might end up as a MRI report/feature request.

needs rebase (waiting for tests) but would like to get this in so I can spent time testing + adding JI stuff.

@kares kares added this to the JRuby milestone Mar 2, 2018
@kares kares requested review from headius and enebo March 2, 2018 16:54
Copy link

might ping you guys on irc on day to talk about repackage an/or third-party jars and its risks for jruby-9.2

Copy link
Member Author

kares commented Mar 8, 2018

already tested with AR-JDBC - all seems well (and working backwards compatible even on master).
likely going to merge this soon, so I can finish up some JI stuff that will require a set of second eyes.

kares added 25 commits March 12, 2018 14:35
kares added 23 commits March 12, 2018 14:36
... this is simply distated by MRI's test suite

we do not handle "big-integer" but that shouldn't matter for real-world
esp. since numeric handling through code-base feels a bit inconsistent
NOTE: MRI does not care for `Time.local` re-definition with `date.to_time`
... driven by one of the last failures -> strftime-ing pico-secs precision
esp. early years has been a consitent surprise around AR-JDBC testing
... somehow naively assumed its re-calculating with the DateTime ctor
@kares kares merged commit cf89614 into master Mar 12, 2018
@kares kares deleted the date_native2 branch March 12, 2018 14:12
kares added a commit that referenced this pull request Mar 26, 2018
resolves GH-5110 ... (another follow-up on date.rb refactoring #5076)
@headius headius mentioned this pull request Mar 28, 2018
15 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

2 participants