Skip to content

YAML.load significant performance degradation when JSON string is included #5098

@vassilios

Description

@vassilios

Environment

  • JRuby version
    jruby 9.1.16.0 (2.3.3) 2018-02-21 8f3f95a OpenJDK 64-Bit Server VM 25.72-b15 on 1.8.0_72-internal-b15 +jit [linux-x86_64]
  • Operating system and platform
    Linux ip-172-30-3-223 3.13.0-74-generic Bump compilation heap size for jruby-1_6 #118-Ubuntu SMP Thu Dec 17 22:52:10 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

Expected Behavior

On jruby 9.1.5.0, 9.1.6.0 and 9.1.7.0, the following gist test_yaml.rb completes in a few milliseconds.

$ jruby test_yaml.rb 
9.1.5.0
  0.240000   0.020000   0.260000 (  0.070586)

$ jruby test_yaml.rb 
9.1.6.0
  0.260000   0.010000   0.270000 (  0.075033)

$ jruby test_yaml.rb 
9.1.7.0
  0.280000   0.000000   0.280000 (  0.080087)

Actual Behavior

The same gist executed with jruby 9.1.8.0 takes more than 10 seconds.

$ jruby test_yaml.rb 
9.1.8.0
 11.570000   0.010000  11.580000 ( 11.411209)

Same thing happens for jruby 9.1.16.0

$ jruby test_yaml.rb 
9.1.16.0
 11.830000   0.010000  11.840000 ( 11.437966)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions