Skip to content

Instantly share code, notes, and snippets.

@enebo
Created August 22, 2010 18:55
Show Gist options
  • Save enebo/544131 to your computer and use it in GitHub Desktop.
Save enebo/544131 to your computer and use it in GitHub Desktop.
Pre-massive refactoring:
./bin/sample small_enum_bench
drives.each 250 of 120 calls: 6.265000 0.000000 6.265000 ( 6.172000)
drives.each 250 of 120 calls: 4.312000 0.000000 4.312000 ( 4.312000)
drives.each 250 of 120 calls: 5.625000 0.000000 5.625000 ( 5.625000)
drives.each 250 of 120 calls: 4.469000 0.000000 4.469000 ( 4.469000)
drives.each 250 of 120 calls: 4.469000 0.000000 4.469000 ( 4.469000)
drives.each 250 of 120 calls: 4.531000 0.000000 4.531000 ( 4.531000)
drives.each 250 of 120 calls: 5.078000 0.000000 5.078000 ( 5.078000)
drives.each 250 of 120 calls: 5.250000 0.000000 5.250000 ( 5.250000)
drives.each 250 of 120 calls: 4.891000 0.000000 4.891000 ( 4.891000)
drives.each 250 of 120 calls: 4.922000 0.000000 4.922000 ( 4.922000)
drives.each 250 of 120 calls: 3.156000 0.000000 3.156000 ( 3.156000)
drives.each 250 of 120 calls: 4.938000 0.000000 4.938000 ( 4.938000)
drives.each 250 of 120 calls: 4.921000 0.000000 4.921000 ( 4.921000)
drives.each 250 of 120 calls: 4.828000 0.000000 4.828000 ( 4.828000)
drives.each 250 of 120 calls: 4.797000 0.000000 4.797000 ( 4.797000)
drives.each 250 of 120 calls: 5.032000 0.000000 5.032000 ( 5.032000)
drives.each 250 of 120 calls: 3.125000 0.000000 3.125000 ( 3.125000)
drives.each 250 of 120 calls: 4.875000 0.000000 4.875000 ( 4.875000)
drives.each 250 of 120 calls: 5.438000 0.000000 5.438000 ( 5.438000)
drives.each 250 of 120 calls: 5.718000 0.000000 5.718000 ( 5.718000)
Post:
./bin/sample small_enum_bench
drives.each 250 of 120 calls: 3.203000 0.000000 3.203000 ( 3.203000)
drives.each 250 of 120 calls: 1.703000 0.000000 1.703000 ( 1.703000)
drives.each 250 of 120 calls: 1.984000 0.000000 1.984000 ( 1.984000)
drives.each 250 of 120 calls: 2.016000 0.000000 2.016000 ( 2.016000)
drives.each 250 of 120 calls: 2.016000 0.000000 2.016000 ( 2.016000)
drives.each 250 of 120 calls: 1.172000 0.000000 1.172000 ( 1.172000)
drives.each 250 of 120 calls: 1.812000 0.000000 1.812000 ( 1.812000)
drives.each 250 of 120 calls: 2.047000 0.000000 2.047000 ( 2.047000)
drives.each 250 of 120 calls: 1.187000 0.000000 1.187000 ( 1.187000)
drives.each 250 of 120 calls: 2.704000 0.000000 2.704000 ( 2.704000)
drives.each 250 of 120 calls: 1.140000 0.000000 1.140000 ( 1.140000)
drives.each 250 of 120 calls: 1.172000 0.000000 1.172000 ( 1.172000)
drives.each 250 of 120 calls: 2.063000 0.000000 2.063000 ( 2.063000)
drives.each 250 of 120 calls: 1.187000 0.000000 1.187000 ( 1.187000)
drives.each 250 of 120 calls: 1.203000 0.000000 1.203000 ( 1.203000)
drives.each 250 of 120 calls: 2.547000 0.000000 2.547000 ( 2.547000)
drives.each 250 of 120 calls: 1.266000 0.000000 1.266000 ( 1.266000)
drives.each 250 of 120 calls: 1.328000 0.000000 1.328000 ( 1.328000)
drives.each 250 of 120 calls: 0.859000 0.000000 0.859000 ( 0.859000)
drives.each 250 of 120 calls: 3.016000 0.000000 3.016000 ( 3.016000)
[Note: About 13.1s is GC time with significant Full GCs]
If we enable not very safe option: -J-Djruby.ji.objectProxyCache=false:
./bin/sample small_enum_bench
drives.each 250 of 120 calls: 1.954000 0.000000 1.954000 ( 1.954000)
drives.each 250 of 120 calls: 0.672000 0.000000 0.672000 ( 0.672000)
drives.each 250 of 120 calls: 0.672000 0.000000 0.672000 ( 0.672000)
drives.each 250 of 120 calls: 0.640000 0.000000 0.640000 ( 0.640000)
drives.each 250 of 120 calls: 0.625000 0.000000 0.625000 ( 0.625000)
drives.each 250 of 120 calls: 0.969000 0.000000 0.969000 ( 0.969000)
drives.each 250 of 120 calls: 0.969000 0.000000 0.969000 ( 0.969000)
drives.each 250 of 120 calls: 0.937000 0.000000 0.937000 ( 0.937000)
drives.each 250 of 120 calls: 0.625000 0.000000 0.625000 ( 0.625000)
drives.each 250 of 120 calls: 0.922000 0.000000 0.922000 ( 0.922000)
drives.each 250 of 120 calls: 0.578000 0.000000 0.578000 ( 0.578000)
drives.each 250 of 120 calls: 0.625000 0.000000 0.625000 ( 0.625000)
drives.each 250 of 120 calls: 0.875000 0.000000 0.875000 ( 0.875000)
drives.each 250 of 120 calls: 0.578000 0.000000 0.578000 ( 0.578000)
drives.each 250 of 120 calls: 0.563000 0.000000 0.563000 ( 0.563000)
drives.each 250 of 120 calls: 0.593000 0.000000 0.593000 ( 0.593000)
drives.each 250 of 120 calls: 0.547000 0.000000 0.547000 ( 0.547000)
drives.each 250 of 120 calls: 0.625000 0.000000 0.625000 ( 0.625000)
drives.each 250 of 120 calls: 0.547000 0.000000 0.547000 ( 0.547000)
drives.each 250 of 120 calls: 0.610000 0.000000 0.610000 ( 0.610000)
Total time = 15.1259999275208
[Note: If we move to Java native extension we will get this and then some since all weakrefs will largely disappear and utils.rb methods will not be using Ruby dyndispatch and not hitting the JI layer]
MRI:
ruby samples/small_enum_bench.rb
ruby samples/small_enum_bench.rb
drives.each 250 of 120 calls: 0.110000 0.219000 0.329000 ( 0.437000)
drives.each 250 of 120 calls: 0.281000 0.094000 0.375000 ( 0.439000)
drives.each 250 of 120 calls: 0.203000 0.156000 0.359000 ( 0.444000)
drives.each 250 of 120 calls: 0.234000 0.172000 0.406000 ( 0.447000)
drives.each 250 of 120 calls: 0.250000 0.109000 0.359000 ( 0.438000)
drives.each 250 of 120 calls: 0.203000 0.141000 0.344000 ( 0.554000)
drives.each 250 of 120 calls: 0.110000 0.203000 0.313000 ( 0.373000)
drives.each 250 of 120 calls: 0.203000 0.141000 0.344000 ( 0.371000)
drives.each 250 of 120 calls: 0.219000 0.125000 0.344000 ( 0.379000)
drives.each 250 of 120 calls: 0.157000 0.156000 0.313000 ( 0.370000)
drives.each 250 of 120 calls: 0.203000 0.109000 0.312000 ( 0.372000)
drives.each 250 of 120 calls: 0.187000 0.156000 0.343000 ( 0.373000)
drives.each 250 of 120 calls: 0.266000 0.079000 0.345000 ( 0.371000)
drives.each 250 of 120 calls: 0.203000 0.093000 0.296000 ( 0.369000)
drives.each 250 of 120 calls: 0.250000 0.047000 0.297000 ( 0.404000)
drives.each 250 of 120 calls: 0.250000 0.110000 0.360000 ( 0.372000)
drives.each 250 of 120 calls: 0.187000 0.125000 0.312000 ( 0.375000)
drives.each 250 of 120 calls: 0.219000 0.125000 0.344000 ( 0.428000)
drives.each 250 of 120 calls: 0.203000 0.140000 0.343000 ( 0.368000)
drives.each 250 of 120 calls: 0.188000 0.141000 0.329000 ( 0.366000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment