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
merged 78 commits into from Mar 12, 2018

Conversation

Projects
None yet
2 participants
@kares
Member

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 9.2.0.0 milestone Mar 2, 2018

@kares kares requested review from headius and enebo Mar 2, 2018

@mkristian

This comment has been minimized.

Member

mkristian commented Mar 5, 2018

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

@kares

This comment has been minimized.

Member

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 some commits Jan 12, 2018

kares added some commits Feb 26, 2018

should use long/long precision for Date's sub-millis + dry-out jd_to_ajd
... this is simply distated by MRI's test suite

we do not handle "big-integer" but that shouldn't matter for real-world
[test] untag passing; tag fractional DateTime specs - quite low priority
esp. since numeric handling through code-base feels a bit inconsistent
at last, also moving Date#to_time to native (for better MRI compat)
NOTE: MRI does not care for `Time.local` re-definition with `date.to_time`
use long precision every-where - not that much users would need this
... driven by one of the last failures -> strftime-ing pico-secs precision
[test] some more (JRuby only) Date/DateTime tests
esp. early years has been a consitent surprise around AR-JDBC testing
work-around JODA considering 'missing' (reform) dates as invalid
... somehow naively assumed its re-calculating with the DateTime ctor

@kares kares merged commit cf89614 into master Mar 12, 2018

0 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/travis-ci/push The Travis CI build is in progress
Details

@kares kares deleted the date_native2 branch Mar 12, 2018

kares added a commit that referenced this pull request Mar 26, 2018

[fix] make sure we account for fractional part on jd/ordinal/civil etc.
resolves GH-5110 ... (another follow-up on date.rb refactoring #5076)

@headius headius referenced this pull request Mar 28, 2018

Open

JRuby 9.2 Projects #5119

6 of 15 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment