Skip to content

Instantly share code, notes, and snippets.

@headius
Created August 2, 2012 04:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save headius/3233714 to your computer and use it in GitHub Desktop.
Save headius/3233714 to your computer and use it in GitHub Desktop.
system ~/projects/jruby/tmp $ jruby -J-Xmx2G --1.8 split_bench.rb
split_bench.rb:38 warning: don't put space before argument parentheses
split_bench.rb:39 warning: don't put space before argument parentheses
split_bench.rb:40 warning: don't put space before argument parentheses
split_bench.rb:41 warning: don't put space before argument parentheses
Rehearsal ------------------------------------------------------------
each_char_next (1000): 1.010000 0.070000 1.080000 ( 0.472000)
each_next! (1000): 0.250000 0.000000 0.250000 ( 0.096000)
split_map_join (1000): 0.250000 0.000000 0.250000 ( 0.107000)
gsub (1000): 0.140000 0.010000 0.150000 ( 0.086000)
each_next! (10000): 0.070000 0.000000 0.070000 ( 0.057000)
split_map_join (10000): 0.150000 0.020000 0.170000 ( 0.095000)
gsub (10000): 0.570000 0.010000 0.580000 ( 0.290000)
each_next! (100000): 15.950000 0.220000 16.170000 ( 3.006000)
split_map_join (100000): 9.030000 0.240000 9.270000 ( 2.616000)
gsub (100000): 2.840000 0.090000 2.930000 ( 0.904000)
-------------------------------------------------- total: 30.920000sec
user system total real
each_char_next (1000): 6.850000 0.060000 6.910000 ( 0.984000)
each_next! (1000): 0.000000 0.000000 0.000000 ( 0.004000)
split_map_join (1000): 0.010000 0.000000 0.010000 ( 0.006000)
gsub (1000): 0.010000 0.000000 0.010000 ( 0.007000)
each_next! (10000): 0.040000 0.000000 0.040000 ( 0.043000)
split_map_join (10000): 0.060000 0.000000 0.060000 ( 0.058000)
gsub (10000): 0.060000 0.000000 0.060000 ( 0.062000)
each_next! (100000): 15.550000 0.060000 15.610000 ( 2.572000)
split_map_join (100000): 3.110000 0.010000 3.120000 ( 0.902000)
gsub (100000): 0.790000 0.000000 0.790000 ( 0.660000)
system ~/projects/jruby/tmp $ jruby -J-Xmx2G --1.9 split_bench.rb
Rehearsal ------------------------------------------------------------
each_char_next (1000): 1.230000 0.070000 1.300000 ( 0.549000)
each_next! (1000): 0.350000 0.000000 0.350000 ( 0.124000)
split_map_join (1000): 0.250000 0.010000 0.260000 ( 0.114000)
gsub (1000): 0.150000 0.000000 0.150000 ( 0.089000)
each_next! (10000): 0.090000 0.020000 0.110000 ( 0.085000)
split_map_join (10000): 0.300000 0.020000 0.320000 ( 0.111000)
gsub (10000): 0.120000 0.000000 0.120000 ( 0.096000)
each_next! (100000): 21.660000 0.350000 22.010000 ( 4.533000)
split_map_join (100000): 12.380000 0.210000 12.590000 ( 2.744000)
gsub (100000): 7.120000 0.110000 7.230000 ( 1.580000)
-------------------------------------------------- total: 44.440000sec
user system total real
each_char_next (1000): 0.150000 0.000000 0.150000 ( 0.118000)
each_next! (1000): 0.010000 0.000000 0.010000 ( 0.005000)
split_map_join (1000): 0.020000 0.000000 0.020000 ( 0.020000)
gsub (1000): 0.010000 0.000000 0.010000 ( 0.009000)
each_next! (10000): 0.050000 0.000000 0.050000 ( 0.056000)
split_map_join (10000): 0.290000 0.010000 0.300000 ( 0.098000)
gsub (10000): 0.070000 0.000000 0.070000 ( 0.072000)
each_next! (100000): 2.690000 0.040000 2.730000 ( 0.832000)
split_map_join (100000): 4.250000 0.000000 4.250000 ( 1.153000)
gsub (100000): 0.740000 0.010000 0.750000 ( 0.720000)
system ~/projects/jruby/tmp $ jruby -J-Xmx2G --1.9 -Xcompile.invokedynamic=true split_bench.rb
Rehearsal ------------------------------------------------------------
each_char_next (1000): 1.260000 0.080000 1.340000 ( 0.580000)
each_next! (1000): 0.470000 0.000000 0.470000 ( 0.160000)
split_map_join (1000): 0.270000 0.010000 0.280000 ( 0.122000)
gsub (1000): 0.170000 0.000000 0.170000 ( 0.093000)
each_next! (10000): 0.090000 0.020000 0.110000 ( 0.086000)
split_map_join (10000): 0.300000 0.020000 0.320000 ( 0.116000)
gsub (10000): 0.130000 0.000000 0.130000 ( 0.097000)
each_next! (100000): 20.240000 0.350000 20.590000 ( 4.329000)
split_map_join (100000): 12.110000 0.220000 12.330000 ( 2.753000)
gsub (100000): 6.920000 0.100000 7.020000 ( 1.556000)
-------------------------------------------------- total: 42.760000sec
user system total real
each_char_next (1000): 0.170000 0.000000 0.170000 ( 0.120000)
each_next! (1000): 0.020000 0.000000 0.020000 ( 0.012000)
split_map_join (1000): 0.020000 0.000000 0.020000 ( 0.021000)
gsub (1000): 0.020000 0.000000 0.020000 ( 0.009000)
each_next! (10000): 0.060000 0.000000 0.060000 ( 0.055000)
split_map_join (10000): 0.280000 0.010000 0.290000 ( 0.101000)
gsub (10000): 0.080000 0.000000 0.080000 ( 0.079000)
each_next! (100000): 2.690000 0.040000 2.730000 ( 0.847000)
split_map_join (100000): 4.260000 0.010000 4.270000 ( 1.173000)
gsub (100000): 0.730000 0.000000 0.730000 ( 0.710000)
system ~/projects/jruby/tmp $ ruby-1.9.3 split_bench.rb
Rehearsal ------------------------------------------------------------
each_char_next (1000): 0.020000 0.000000 0.020000 ( 0.020323)
each_next! (1000): 0.020000 0.000000 0.020000 ( 0.019421)
split_map_join (1000): 0.020000 0.000000 0.020000 ( 0.019064)
gsub (1000): 0.010000 0.000000 0.010000 ( 0.015810)
each_next! (10000): 0.180000 0.010000 0.190000 ( 0.183270)
split_map_join (10000): 0.170000 0.000000 0.170000 ( 0.177089)
gsub (10000): 0.150000 0.010000 0.160000 ( 0.147201)
each_next! (100000): 1.760000 0.040000 1.800000 ( 1.811102)
split_map_join (100000): 1.750000 0.040000 1.790000 ( 1.787265)
gsub (100000): 1.360000 0.050000 1.410000 ( 1.400548)
--------------------------------------------------- total: 5.590000sec
user system total real
each_char_next (1000): 0.020000 0.000000 0.020000 ( 0.018366)
each_next! (1000): 0.020000 0.000000 0.020000 ( 0.017392)
split_map_join (1000): 0.020000 0.000000 0.020000 ( 0.016815)
gsub (1000): 0.010000 0.000000 0.010000 ( 0.014711)
each_next! (10000): 0.160000 0.000000 0.160000 ( 0.159611)
split_map_join (10000): 0.160000 0.000000 0.160000 ( 0.156421)
gsub (10000): 0.130000 0.000000 0.130000 ( 0.131145)
each_next! (100000): 1.820000 0.020000 1.840000 ( 1.839838)
split_map_join (100000): 1.630000 0.030000 1.660000 ( 1.656507)
gsub (100000): 1.330000 0.000000 1.330000 ( 1.331375)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment