diff --git a/Gemfile b/Gemfile index 79f6d80..aa89ae0 100644 --- a/Gemfile +++ b/Gemfile @@ -16,7 +16,6 @@ group :development, :test do gem "test-unit" gem "ci_reporter" gem "ruby-prof" unless RUBY_PLATFORM =~ /java/ - gem "perftools.rb" unless RUBY_PLATFORM =~ /java/ gem "rake-compiler" # Java @@ -26,3 +25,6 @@ group :development, :test do gem "jruby-openssl" end end + +gem "perftools.rb", :group => :development unless RUBY_PLATFORM =~ /java/ + diff --git a/bench/exp_series.html b/bench/exp_series.html index a2b9fb0..9917e8e 100644 --- a/bench/exp_series.html +++ b/bench/exp_series.html @@ -41,7 +41,6 @@ } function flotSeries(expSeries, xMax, labelSpec, plotSpecs) { return $.map(plotSpecs, function(plotSpec, i){ - var base = plotSpec.base; var gen = plotSpec.generator; var op = plotSpec.operation; return { label: labelSpec + ': ' + plotSpec[labelSpec], data: genOpXY(expSeries, xMax, plotSpec, 'exp2', 'ops'), @@ -68,70 +67,83 @@ $(function () { { xaxis: { ticks: xExpTicks }, yaxes: [ { min: 0 } ], - legend: { position: 'ne' } + legend: { position: 'ne' }, + grid: { hoverable: true } }); } // comment pending var graph = [ - [ 'value_string_size insert C versus Ruby', 14, 'mongo_driver_mode', + [ 'value_string_size insert C versus Ruby', 14, 'mode', [ - { base:2, generator:'value_string_size', operation:'insert', mongo_driver_mode: 'c' }, - { base:2, generator:'value_string_size', operation:'insert', mongo_driver_mode: 'ruby' } + { base:2, generator:'value_string_size', operation:'insert', mode: 'c', tag: 'array_slow' }, + { base:2, generator:'value_string_size', operation:'insert', mode: 'ruby', tag: 'orig_ruby' } ] ], - [ 'key_string_size insert C versus Ruby', 14, 'mongo_driver_mode', + [ 'key_string_size insert C versus Ruby', 14, 'mode', [ - { base:2, generator:'key_string_size', operation:'insert', mongo_driver_mode: 'c' }, - { base:2, generator:'key_string_size', operation:'insert', mongo_driver_mode: 'ruby' } + { base:2, generator:'key_string_size', operation:'insert', mode: 'c', tag: 'array_slow' }, + { base:2, generator:'key_string_size', operation:'insert', mode: 'ruby', tag: 'orig_ruby' } ] ], - [ 'array_size_fixnum insert C versus Ruby', 12, 'mongo_driver_mode', + [ 'array_size_fixnum insert C versus Ruby', 12, 'mode', [ - { base:2, generator:'array_size_fixnum', operation:'insert', mongo_driver_mode: 'c' }, - { base:2, generator:'array_size_fixnum', operation:'insert', mongo_driver_mode: 'ruby' } + { base:2, generator:'array_size_fixnum', operation:'insert', mode: 'c', tag: 'array_slow' }, + { base:2, generator:'array_size_fixnum', operation:'insert', mode: 'ruby', tag: 'orig_ruby' } ] ], - [ 'hash_size_fixnum insert C versus Ruby', 12, 'mongo_driver_mode', + [ 'hash_size_fixnum insert C versus Ruby', 12, 'mode', [ - { base:2, generator:'hash_size_fixnum', operation:'insert', mongo_driver_mode: 'c' }, - { base:2, generator:'hash_size_fixnum', operation:'insert', mongo_driver_mode: 'ruby' } + { base:2, generator:'hash_size_fixnum', operation:'insert', mode: 'c', tag: 'array_slow' }, + { base:2, generator:'hash_size_fixnum', operation:'insert', mode: 'ruby', tag: 'orig_ruby' } ] ], - [ 'array_nest_fixnum base 2 insert C versus Ruby', 12, 'mongo_driver_mode', + [ 'array_nest_fixnum base 2 insert C versus Ruby', 12, 'mode', [ - { base:2, generator:'array_nest_fixnum', operation:'insert', mongo_driver_mode:'c' }, - { base:2, generator:'array_nest_fixnum', operation:'insert', mongo_driver_mode:'ruby' } + { base:2, generator:'array_nest_fixnum', operation:'insert', mode:'c', tag: 'array_slow' }, + { base:2, generator:'array_nest_fixnum', operation:'insert', mode:'ruby', tag: 'orig_ruby' } ] ], - [ 'hash_nest_fixnum base 2 insert C versus Ruby', 12, 'mongo_driver_mode', + [ 'hash_nest_fixnum base 2 insert C versus Ruby', 12, 'mode', [ - { base:2, generator:'hash_nest_fixnum', operation:'insert', mongo_driver_mode: 'c' }, - { base:2, generator:'hash_nest_fixnum', operation:'insert', mongo_driver_mode: 'ruby' } + { base:2, generator:'hash_nest_fixnum', operation:'insert', mode: 'c', tag: 'array_slow' }, + { base:2, generator:'hash_nest_fixnum', operation:'insert', mode: 'ruby', tag: 'orig_ruby' } ] ], [ 'array_nest_fixnum insert C by base', 12, 'base', [ - { base:2, generator:'array_nest_fixnum', operation:'insert', mongo_driver_mode: 'c' }, - { base:4, generator:'array_nest_fixnum', operation:'insert', mongo_driver_mode: 'c' }, - { base:8, generator:'array_nest_fixnum', operation:'insert', mongo_driver_mode: 'c' }, - { base:16, generator:'array_nest_fixnum', operation:'insert', mongo_driver_mode: 'c' }, - { base:32, generator:'array_nest_fixnum', operation:'insert', mongo_driver_mode: 'c' } + { base:2, generator:'array_nest_fixnum', operation:'insert', mode: 'c', tag: 'array_slow' }, + { base:4, generator:'array_nest_fixnum', operation:'insert', mode: 'c', tag: 'array_slow' }, + { base:8, generator:'array_nest_fixnum', operation:'insert', mode: 'c', tag: 'array_slow' }, + { base:16, generator:'array_nest_fixnum', operation:'insert', mode: 'c', tag: 'array_slow' }, + { base:32, generator:'array_nest_fixnum', operation:'insert', mode: 'c', tag: 'array_slow' } ] ], [ 'hash_nest_fixnum insert C by base', 12, 'base', [ - { base:2, generator:'hash_nest_fixnum', operation:'insert', mongo_driver_mode: 'c' }, - { base:4, generator:'hash_nest_fixnum', operation:'insert', mongo_driver_mode: 'c' }, - { base:8, generator:'hash_nest_fixnum', operation:'insert', mongo_driver_mode: 'c' }, - { base:16, generator:'hash_nest_fixnum', operation:'insert', mongo_driver_mode: 'c' }, - { base:32, generator:'hash_nest_fixnum', operation:'insert', mongo_driver_mode: 'c' } + { base:2, generator:'hash_nest_fixnum', operation:'insert', mode: 'c', tag: 'array_slow' }, + { base:4, generator:'hash_nest_fixnum', operation:'insert', mode: 'c', tag: 'array_slow' }, + { base:8, generator:'hash_nest_fixnum', operation:'insert', mode: 'c', tag: 'array_slow' }, + { base:16, generator:'hash_nest_fixnum', operation:'insert', mode: 'c', tag: 'array_slow' }, + { base:32, generator:'hash_nest_fixnum', operation:'insert', mode: 'c', tag: 'array_slow' } ] ], - [ 'array_size_fixnum versus hash_size_fixnum insert C', 12, 'generator', + [ 'array_size_fixnum slow versus hash_size_fixnum insert C', 12, 'generator', [ - { base:2, generator:'array_size_fixnum', operation:'insert', mongo_driver_mode: 'c' }, - { base:2, generator:'hash_size_fixnum', operation:'insert', mongo_driver_mode: 'c' } + { base:2, generator:'array_size_fixnum', operation:'insert', mode: 'c', tag: 'array_slow' }, + { base:2, generator:'hash_size_fixnum', operation:'insert', mode: 'c', tag: 'array_slow' } + ] + ], + [ 'array_size_fixnum fast versus hash_size_fixnum insert C', 12, 'generator', + [ + { base:2, generator:'array_size_fixnum', operation:'insert', mode: 'c', tag: 'array_fast' }, + { base:2, generator:'hash_size_fixnum', operation:'insert', mode: 'c', tag: 'array_slow' } + ] + ], + [ 'array_size_fixnum slow versus fast insert C', 12, 'tag', + [ + { base:2, generator:'array_size_fixnum', operation:'insert', mode: 'c', tag: 'array_slow' }, + { base:2, generator:'array_size_fixnum', operation:'insert', mode: 'c', tag: 'array_fast' } ] ] ]; @@ -142,6 +154,41 @@ $(function () { doPlot(title, series); }); + function showTooltip(x, y, contents) { + $('