Project

General

Profile

Bug #14080

Performance issue with Marshal.dump and Array of Floats - 100x regression in 2.3.x

Added by pbfein (Peter Fein) about 2 years ago. Updated 4 months ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-darwin15]
[ruby-core:83677]

Description

I am using Marshal.dump on array of Floats with Ruby 2.3.3 (same issue in 2.3.5). In our program with an Array size of 1M it seems to hang indefinitely. I take it down to 100K Floats and it takes about 10 seconds. My sample program loads an marshaled Array of 100K floats from the .data file and then dumps it again. Benchmark from various rubies showing the 2.3.x regression from 1.9 and then fixed again in 2.4.2.

$ rvm use 2.3.3
$ruby marshall_slow.rb
12.240000 0.040000 12.280000 ( 12.314731)

$rvm use 2.3.5
$ruby marshall_slow.rb
11.230000 0.030000 11.260000 ( 11.285143)

$ rvm use 1.9.3
$ ruby marshall_slow.rb
0.110000 0.000000 0.110000 ( 0.115007)

$ rvm use 2.4.2
$ ruby marshall_slow.rb
0.090000 0.000000 0.090000 ( 0.083619)


Files

marshall_slow.rb (188 Bytes) marshall_slow.rb pbfein (Peter Fein), 11/05/2017 05:06 AM
marshalled_floats.data.gz (878 KB) marshalled_floats.data.gz pbfein (Peter Fein), 11/05/2017 05:06 AM

History

#1

Updated by pbfein (Peter Fein) about 2 years ago

  • Subject changed from Performance issue with Marshall.dump and Array of Floats - 100x regression in 2.3.x to Performance issue with Marshal.dump and Array of Floats - 100x regression in 2.3.x
#2

Updated by pbfein (Peter Fein) about 2 years ago

  • Description updated (diff)
#3

Updated by jeremyevans0 (Jeremy Evans) 4 months ago

  • Status changed from Open to Closed

Also available in: Atom PDF