Marshal's dump/load is 5x-20x times slower when reading/writing from/to files
-----------------------------------------------------------------------------
Key: JRUBY-4308
URL: http://jira.codehaus.org/browse/JRUBY-4308
Project: JRuby
Issue Type: Bug
Components: Core Classes/Modules
Affects Versions: JRuby 1.4
Environment: jruby-dev
Reporter: Vladimir Sizikov
Assignee: Vladimir Sizikov
Fix For: JRuby 1.5
Take a look. The diff is very clear, 10x! Will fix.
JRuby:
{code}
D:\work\jruby-dev\jruby>jruby --server bench\bench_marshal.rb
Rehearsal
-----------------------------------------------------------------------------
control 0.181000 0.000000 0.181000 (
0.130000)
dump short string 0.440000 0.000000 0.440000 (
0.441000)
dump short string to file 2.814000 0.000000 2.814000 (
2.814000)
dump long string 1.550000 0.000000 1.550000 (
1.550000)
dump long string to file 0.056000 0.000000 0.056000 (
0.056000)
dump short array 0.471000 0.000000 0.471000 (
0.470000)
dump short array to file 10.251000 0.000000 10.251000 (
10.251000)
dump long array (0.01 * iters) 2.492000 0.000000 2.492000 (
2.492000)
dump long array (0.01 * iters) to file 85.901000 0.000000 85.901000 (
85.902000)
dump short hash 0.466000 0.000000 0.466000 (
0.466000)
dump short hash to file 10.329000 0.000000 10.329000 (
10.329000)
dump long hash (0.01 * iters) 2.716000 0.000000 2.716000 (
2.716000)
dump long hash (0.01 * iters) to file 126.846000 0.000000 126.846000
(126.846000)
load short string 0.201000 0.000000 0.201000 (
0.201000)
load short string from file 2.142000 0.000000 2.142000 (
2.142000)
load long string 0.785000 0.000000 0.785000 (
0.785000)
load long string (0.01 * iters) from file 0.042000 0.000000 0.042000 (
0.042000)
load short array 0.163000 0.000000 0.163000 (
0.163000)
load short array from file 7.083000 0.000000 7.083000 (
7.083000)
load long array (0.01 * iters) 0.470000 0.000000 0.470000 (
0.470000)
load long array (0.01 * iters) from file 58.649000 0.000000 58.649000 (
58.649000)
load short hash 0.198000 0.000000 0.198000 (
0.198000)
load short hash from file 7.229000 0.000000 7.229000 (
7.229000)
load long hash (0.01 * iters) 1.357000 0.000000 1.357000 (
1.358000)
load long hash (0.01 * iters) from file 125.709000 0.000000 125.709000
(125.709000)
------------------------------------------------------------------ total:
448.541000sec
{code}
MRI:
{code}
D:\work\jruby-dev\jruby>ruby bench\bench_marshal.rb
Rehearsal
-----------------------------------------------------------------------------
control 0.156000 0.000000 0.156000 (
0.152009)
dump short string 0.359000 0.015000 0.374000 (
1.023059)
dump short string to file 0.530000 0.000000 0.530000 (
0.721041)
dump long string 0.905000 1.279000 2.184000 (
3.675210)
dump long string (0.01 * iters) to file 0.031000 0.016000 0.047000 (
0.038002)
dump short array 0.499000 0.000000 0.499000 (
0.894051)
dump short array to file 0.671000 0.000000 0.671000 (
1.001057)
dump long array (0.01 * iters) 1.654000 0.031000 1.685000 (
2.499143)
dump long array (0.01 * iters) to file 1.903000 0.047000 1.950000 (
2.203126)
dump short hash 0.530000 0.016000 0.546000 (
0.538031)
dump short hash to file 0.687000 0.000000 0.687000 (
0.769044)
dump long hash (0.01 * iters) 3.385000 0.031000 3.416000 (
3.502200)
dump long hash (0.01 * iters) to file 3.572000 0.031000 3.603000 (
3.726213)
load short string 0.250000 0.000000 0.250000 (
0.241014)
load short string from file 0.515000 0.016000 0.531000 (
0.542031)
load long string 1.029000 0.592000 1.621000 (
1.720099)
load long string (0.01 * iters) from file 0.016000 0.032000 0.048000 (
0.056003)
load short array 0.327000 0.000000 0.327000 (
0.332019)
load short array from file 1.295000 0.015000 1.310000 (
1.616092)
load long array (0.01 * iters) 0.905000 0.000000 0.905000 (
1.023059)
load long array (0.01 * iters) from file 6.521000 0.094000 6.615000 (
6.869393)
load short hash 0.437000 0.015000 0.452000 (
0.474027)
load short hash from file 1.357000 0.032000 1.389000 (
1.417081)
load long hash (0.01 * iters) 2.652000 0.000000 2.652000 (
2.744157)
load long hash (0.01 * iters) from file 13.697000 0.202000 13.899000 (
14.357821)
------------------------------------------------------------------- total:
46.347000sec
{code}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email