Skip to content

Introduce Date._strptime in Java to improve the performance #4591

@muga

Description

@muga

Overview

  • I want to improve the performance of Date._strptime method.
  • I'm implementing Date._strptime in Java on Java timestamp parser and RubyDateParser embulk/embulk#608
  • Can you consider about introducing our implementation to JRuby? If you agree, I will work on it after completing the implementation.

Details

My application, Embulk, is using JRuby and heavily using Date._strptime method internally to parse timestamp strings. I found that the heavy usage is one of the performance bottlenecks in my application.
To mitigate the performance issue, I started implementing Date._strptime in Java. The features are:

  • 100% compatibility with the specification of Date._strptime in CRuby
  • Faster performance because the # of objects passing is reduced between Java and (J)Ruby
  • The implementation uses similar approach with org.jruby.util.RubyDateFormatter and org.jruby.lexer.StrftimeLexer.

Environment

  • JRuby 9.1.5.0
  • Java 1.8.0_91 64-Bit Server VM (build 25.91-b14, mixed mode)
  • Ubuntu 16.04

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions