Skip to content

Commit

Permalink
Revert cbson.c, to be revisited for malloc/free reduction.
Browse files Browse the repository at this point in the history
README.md has API Documentation note at the top to help users match documentation to driver version, DOCS-197.
 Expanded performance tests, for insert with multiple docs.
  • Loading branch information
gjmurakami-10gen committed May 3, 2012
1 parent ca7bf20 commit 50d6902
Show file tree
Hide file tree
Showing 6 changed files with 980 additions and 639 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Expand Up @@ -9,6 +9,8 @@ group :development, :test do

# Deployment
gem "git"
gem "redcarpet"
gem "yard"

# Testing
gem "mocha"
Expand Down
23 changes: 14 additions & 9 deletions README.md
@@ -1,3 +1,17 @@
# Documentation

This API documentation is available online at [http://api.mongodb.org/ruby](http://api.mongodb.org/ruby)
for all releases of the MongoDB Ruby driver. Please reference the exact version of the documentation
that matches the release of the Ruby driver that you are using. Note that the
[Ruby Language Center for MongoDB](http://www.mongodb.org/display/DOCS/Ruby+Language+Center)
has a link to API Documentation for the current release.

If you have the source, you can generate the matching documentation by typing

$ rake ydoc

Then open the file +ydoc/index.html+.

# Introduction

This is the 10gen-supported Ruby driver for [MongoDB](http://www.mongodb.org).
Expand Down Expand Up @@ -300,15 +314,6 @@ If you want to test replica set, you can run the following task:

$ rake test:rs

# Documentation

This documentation is available online at [http://api.mongodb.org/ruby](http://api.mongodb.org/ruby). You can
generate the documentation if you have the source by typing

$ rake ydoc

Then open the file +ydoc/index.html+.

# Release Notes

See HISTORY.
Expand Down
131 changes: 72 additions & 59 deletions bench/exp_series.html
Expand Up @@ -18,13 +18,18 @@
width:800px;
height:400px;
}
div.hidden {
//display: none; //visibility: hidden; // to collapse, use display: none
}
</style>
</head>
<body>
<h1>Exp Series Performance Tests</h1>
x-axis is power of 2, log base 2 of size<br>
y-axis is operations per user-time CPU-second<br>
Note that this is not operations per real-time second that include DB real-time<br>
y-axis is "document" operations per second, ex., total document insertions per second<br>
<br>
For measuring Ruby driver performance, we are interested primarily in the "user" CPU time.<br>
The "user" time is the time used by the Ruby driver, typically much less than real time.<br>
<div id="placeholder"></div>

<script type="text/javascript">
Expand All @@ -42,7 +47,7 @@ <h1>Exp Series Performance Tests</h1>
return $.map(plotSpecs, function(plotSpec, i){
return {
label: labelSpec + ': ' + plotSpec[labelSpec],
data: genOpXY(expSeries, xMax, plotSpec, 'exp2', 'ops'),
data: genOpXY(expSeries, xMax, plotSpec, 'exp2', 'ut_ops'),
lines: { show: true },
points: { show: true }
};
Expand All @@ -58,117 +63,120 @@ <h1>Exp Series Performance Tests</h1>
}
return res;
}
function doPlot(title, series) {
function doPlot(title, series, classes) {
var id = title.replace(/\W/g,'_');
$("#placeholder").append('<h1>' + title + '</h1><div id="' + id + '" class="graph"></div>');
$.plot($('#' + id),
series,
{
xaxis: { ticks: xExpTicks },
yaxes: [ { min: 0 } ],
legend: { position: 'ne' },
grid: { hoverable: true }
});
$("#placeholder").append('<h3>' + title + '</h3><div id="show_hide_' + id + '" class="show_hide">Show/Hide</div><div id="' + id + '" class="graph"></div>');
var e = $('#' + id);
$.plot(e, series, {
xaxis:{ ticks:xExpTicks },
yaxes:[
{ min:0 }
],
legend:{ position:'ne' },
grid:{ hoverable:true }
});
e.addClass(classes);
}

// comment pending
var graph = [
[ 'value_string_size insert C versus Ruby', 14, 'mode',
[ '#placeholder', 'value_string_size insert C versus Ruby', 'hidden', 14, 'mode',
[
{ 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' }
{ base:2, generator:'value_string_size', operation:'insert', mode: 'c', tag: 'base_c' },
{ base:2, generator:'value_string_size', operation:'insert', mode: 'ruby', tag: 'base_ruby' }
]
],
[ 'key_string_size insert C versus Ruby', 14, 'mode',
[ '#placeholder', 'key_string_size insert C versus Ruby', 'hidden', 14, 'mode',
[
{ 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' }
{ base:2, generator:'key_string_size', operation:'insert', mode: 'c', tag: 'base_c' },
{ base:2, generator:'key_string_size', operation:'insert', mode: 'ruby', tag: 'base_ruby' }
]
],
[ 'array_size_fixnum insert C versus Ruby', 12, 'mode',
[ '#placeholder', 'array_size_fixnum insert C versus Ruby', 'hidden', 12, 'mode',
[
{ 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' }
{ base:2, generator:'array_size_fixnum', operation:'insert', mode: 'c', tag: 'base_c' },
{ base:2, generator:'array_size_fixnum', operation:'insert', mode: 'ruby', tag: 'base_ruby' }
]
],
[ 'hash_size_fixnum insert C versus Ruby', 12, 'mode',
[ '#placeholder', 'hash_size_fixnum insert C versus Ruby', 'hidden', 12, 'mode',
[
{ 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' }
{ base:2, generator:'hash_size_fixnum', operation:'insert', mode: 'c', tag: 'base_c' },
{ base:2, generator:'hash_size_fixnum', operation:'insert', mode: 'ruby', tag: 'base_ruby' }
]
],
[ 'array_nest_fixnum base 2 insert C versus Ruby', 12, 'mode',
[ '#placeholder', 'array_nest_fixnum base 2 insert C versus Ruby', 'hidden', 12, 'mode',
[
{ 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' }
{ base:2, generator:'array_nest_fixnum', operation:'insert', mode:'c', tag: 'base_c' },
{ base:2, generator:'array_nest_fixnum', operation:'insert', mode:'ruby', tag: 'base_ruby' }
]
],
[ 'hash_nest_fixnum base 2 insert C versus Ruby', 12, 'mode',
[ '#placeholder', 'hash_nest_fixnum base 2 insert C versus Ruby', 'hidden', 12, 'mode',
[
{ 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' }
{ base:2, generator:'hash_nest_fixnum', operation:'insert', mode: 'c', tag: 'base_c' },
{ base:2, generator:'hash_nest_fixnum', operation:'insert', mode: 'ruby', tag: 'base_ruby' }
]
],
[ 'array_nest_fixnum insert C by base', 12, 'base',
[ '#placeholder', 'array_nest_fixnum insert C by base', 'hidden', 12, 'base',
[
{ 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' }
{ base:2, generator:'array_nest_fixnum', operation:'insert', mode: 'c', tag: 'base_c_nest_full' },
{ base:4, generator:'array_nest_fixnum', operation:'insert', mode: 'c', tag: 'base_c_nest_full' },
{ base:8, generator:'array_nest_fixnum', operation:'insert', mode: 'c', tag: 'base_c_nest_full' },
{ base:16, generator:'array_nest_fixnum', operation:'insert', mode: 'c', tag: 'base_c_nest_full' },
{ base:32, generator:'array_nest_fixnum', operation:'insert', mode: 'c', tag: 'base_c_nest_full' }
]
],
[ 'hash_nest_fixnum insert C by base', 12, 'base',
[ '#placeholder', 'hash_nest_fixnum insert C by base', 'hidden', 12, 'base',
[
{ 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' }
{ base:2, generator:'hash_nest_fixnum', operation:'insert', mode: 'c', tag: 'base_c_nest_full' },
{ base:4, generator:'hash_nest_fixnum', operation:'insert', mode: 'c', tag: 'base_c_nest_full' },
{ base:8, generator:'hash_nest_fixnum', operation:'insert', mode: 'c', tag: 'base_c_nest_full' },
{ base:16, generator:'hash_nest_fixnum', operation:'insert', mode: 'c', tag: 'base_c_nest_full' },
{ base:32, generator:'hash_nest_fixnum', operation:'insert', mode: 'c', tag: 'base_c_nest_full' }
]
],
[ 'array_size_fixnum slow versus hash_size_fixnum insert C', 12, 'generator',
[ '#placeholder', 'array_size_fixnum slow versus hash_size_fixnum insert C', '', 12, 'generator',
[
{ 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' }
{ base:2, generator:'array_size_fixnum', operation:'insert', mode: 'c', tag: 'base_c' },
{ base:2, generator:'hash_size_fixnum', operation:'insert', mode: 'c', tag: 'base_c' }
]
],
[ 'array_size_fixnum slow versus fast insert C', 12, 'tag',
[ '#placeholder', 'array_size_fixnum slow versus fast insert C', 'hidden', 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: 'base_c' },
{ base:2, generator:'array_size_fixnum', operation:'insert', mode: 'c', tag: 'array_fast' }
]
],
[ 'array_size_fixnum fast versus hash_size_fixnum insert C', 12, 'generator',
[ '#placeholder', 'array_size_fixnum fast versus hash_size_fixnum insert C', 'hidden', 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' }
{ base:2, generator:'hash_size_fixnum', operation:'insert', mode: 'c', tag: 'base_c' }
]
],
[ 'array_nest_fixnum slow versus hash_nest_fixnum insert C base 2', 12, 'generator',
[ '#placeholder', 'array_nest_fixnum slow versus hash_nest_fixnum insert C base 2', 'hidden', 12, 'generator',
[
{ base:2, generator:'array_nest_fixnum', operation:'insert', mode: 'c', tag: 'array_slow' },
{ base:2, generator:'hash_nest_fixnum', operation:'insert', mode: 'c', tag: 'array_slow' }
{ base:2, generator:'array_nest_fixnum', operation:'insert', mode: 'c', tag: 'base_c' },
{ base:2, generator:'hash_nest_fixnum', operation:'insert', mode: 'c', tag: 'base_c' }
]
],
[ 'array_nest_fixnum slow versus fast insert C base 2', 12, 'tag',
[ '#placeholder', 'array_nest_fixnum slow versus fast insert C base 2', 'hidden', 12, 'tag',
[
{ base:2, generator:'array_nest_fixnum', operation:'insert', mode: 'c', tag: 'array_slow' },
{ base:2, generator:'array_nest_fixnum', operation:'insert', mode: 'c', tag: 'base_c' },
{ base:2, generator:'array_nest_fixnum', operation:'insert', mode: 'c', tag: 'array_fast' }
]
],
[ 'array_nest_fixnum fast versus hash_nest_fixnum insert C base 2', 12, 'generator',
[ '#placeholder', 'array_nest_fixnum fast versus hash_nest_fixnum insert C base 2', 'hidden', 12, 'generator',
[
{ base:2, generator:'array_nest_fixnum', operation:'insert', mode: 'c', tag: 'array_fast' },
{ base:2, generator:'hash_nest_fixnum', operation:'insert', mode: 'c', tag: 'array_fast' }
]
],
];
$.each(graph, function(i, e){
var title, xMax, labelSpec, plotSpecs;
title = e[0]; xMax = e[1]; labelSpec = e[2]; plotSpecs = e[3]; //[title, xMax, labelSpec, plotSpecs] = e;
var section, title, classes, xMax, labelSpec, plotSpecs;
//[section, title, classes, xMax, labelSpec, plotSpecs] = e;
section = e[0], title = e[1]; classes = e[2], xMax = e[3]; labelSpec = e[4]; plotSpecs = e[5];
var series = flotSeries(expSeries, xMax, labelSpec, plotSpecs);
doPlot(title, series);
doPlot(title, series, classes);
});

function showTooltip(x, y, contents) {
Expand Down Expand Up @@ -206,6 +214,11 @@ <h1>Exp Series Performance Tests</h1>
}
});

$('.show_hide').bind('click', function(event) {
var id = $(this).attr('id').replace(/^show_hide_/, '');
$('#' + id).toggleClass('hidden');
});

});
</script>
</body>
Expand Down

0 comments on commit 50d6902

Please sign in to comment.