mongo-ruby-driver/bench/exp_series.html

676 lines
49 KiB
HTML
Raw Permalink Normal View History

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Exp Series Performance Tests</title>
<!-- http://code.google.com/p/flot/ -->
<!--[if lte IE 8]><script language="javascript" type="text/javascript" src="excanvas.min.js"></script><![endif]-->
<script language="javascript" type="text/javascript" src="jquery.js"></script>
<script language="javascript" type="text/javascript" src="jquery.flot.js"></script>
<script language="javascript" type="text/javascript" src="exp_series_suite_insert_one_c.js"></script>
<script language="javascript" type="text/javascript" src="exp_series_suite_insert_one_ruby.js"></script>
<script language="javascript" type="text/javascript" src="exp_series_suite_insert_many_c.js"></script>
<script language="javascript" type="text/javascript" src="exp_series_suite_insert_many_ruby.js"></script>
<script language="javascript" type="text/javascript" src="exp_series_suite_find_c.js"></script>
<script language="javascript" type="text/javascript" src="exp_series_suite_find_ruby.js"></script>
<script language="javascript" type="text/javascript" src="exp_series_suite_nest_c.js"></script>
<script language="javascript" type="text/javascript" src="exp_series_suite_nest_ruby.js"></script>
<style type="text/css">
body {
font-family: sans-serif;
font-size: 16px;
margin: 50px;
}
h2 {
padding: 20px;
background-color: lightblue;
}
.title {
font-weight: bold;
margin: 20px;
}
.show_hide, #show_all, #show_default {
padding: 1px;
line-height: 200%;
cursor: pointer;
background-color: LightGray;
}
.graph {
width:800px;
height:400px;
}
.note {
margin: 20px;
}
.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 "document" operations per second, ex., total document insertions per second<br/>
<br/>
user_ops are operations per user-CPU-time second<br/>
real_ops are operations per real-time 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 less than real time.<br/>
<br/>
<span id="show_all">Show All</span> <span id="show_default">Show Default</span>
<hr/>
<h2>Issues</h2><div id="array_slow"></div>
<hr/>
<h2>Best Practices</h2><div id="best_practices"></div>
<hr/>
<h2>Insert Many Safe - with Data Sizes</h2><p>Insert many safe is faster than insert one safe especially for increasing multiples and for smaller data, as expected.</p><div id="insert_many_safe"></div>
<hr/>
<h2>Insert Many - with Data Sizes</h2><p>Insert many is faster than insert one especially for increasing multiples and for smaller data, as expected.</p><div id="insert_many"></div>
<hr/>
<h2>Insert One Fast versus Safe - with Real Time</h2><p>Fast mode is significantly faster than safe mode especially for smaller data, as expected.</p><div id="insert_one_safe"></div>
<hr/>
<h2>Find Many versus Find One - with Real Time</h2><p>Find many with cursor is significantly faster than find one, as expected.</p><div id="find"></div>
<hr/>
<h2>C versus Ruby - with Real Time</h2><p>The C extension is significantly faster than Ruby, as expected.</p><div id="c_vs_ruby"></div>
<hr/>
<h2>Nested Structures</h2><p>The deeper binary nested array is slower than broader structures with the same number of leaves, so we omit broader structures in other tests.</p><div id="nested"></div>
<hr/>
<script type="text/javascript">
suite = [
exp_series_suite_insert_one_c,
exp_series_suite_insert_one_ruby,
exp_series_suite_insert_many_c,
exp_series_suite_insert_many_ruby,
exp_series_suite_find_c,
exp_series_suite_find_ruby,
exp_series_suite_nest_c,
exp_series_suite_nest_ruby
];
expSeries = [];
for (i in suite) { expSeries = expSeries.concat(suite[i]); }
function genOpXY(a, xMax, plotSpec) {
2012-04-16 21:28:48 +00:00
var genOpA = $.grep(a, function(e, i){
if (e.exp2 > xMax) return false;
for (var key in plotSpec) {
if (key != 'x' && key != 'y' && e[key] != plotSpec[key]) return false;
2012-04-16 21:28:48 +00:00
}
return true;
});
return $.map(genOpA, function(e, i){return [[e[plotSpec.x], e[plotSpec.y]]];});
}
function flotSeries(expSeries, xMax, labelSpec, plotLines) {
return $.map(plotLines, function(plotSpec, i){
return {
label: plotSpec.y + ', ' + labelSpec + ': ' + plotSpec[labelSpec],
data: genOpXY(expSeries, xMax, plotSpec),
lines: { show: true },
points: { show: true }
};
});
}
$(function () {
function xExpTicks(axis) {
var res = [];
for (var i = axis.min; i <= axis.max; i++) {
res.push([i, i + ':' + Math.pow(2,i)]);
}
return res;
}
function doPlot(section, title, series, classes, notes) {
var id = title.replace(/\W/g,'_');
$(section).append('<hr/>' +
'<span id="show_hide_' + id + '" class="show_hide">Show/Hide</span>' +
'<span class="title">' + title + '</span>' +
'<span id="note_' + id + '" class="note"></span>' +
'<div id="' + id + '" class="graph"></div>');
$('#note_' + id).text(notes);
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 = [
[ '#array_slow', 'array_size_fixnum slow versus hash_size_fixnum insert one C', '', 12, 'generator',
2012-04-16 21:28:48 +00:00
[
{ x:'exp2', y:'user_ops', generator:'array_size_fixnum', operation:'insert', mode:'c', tag:'suite_insert_one', status:'OK' },
{ x:'exp2', y:'user_ops', generator:'hash_size_fixnum', operation:'insert', mode:'c', tag:'suite_insert_one', status:'OK' }
],
'Array insertion is significantly slower than hash insertion. ' +
'Investigation shows that there is an extra malloc/free for each array index key. '
],
[ '#array_slow', 'array_size_fixnum fast versus slow insert one C', '', 12, 'tag',
2012-04-16 21:28:48 +00:00
[
{ x:'exp2', y:'user_ops', generator:'array_size_fixnum', operation:'insert', mode:'c', tag:'array_fast', status:'OK' },
{ x:'exp2', y:'user_ops', generator:'array_size_fixnum', operation:'insert', mode:'c', tag:'suite_insert_one', status:'OK' }
],
'Pending: Array insertion is now faster.'
],
[ '#array_slow', 'array_size_fixnum fast versus hash_size_fixnum insert one C', '', 12, 'generator',
2012-04-16 21:28:48 +00:00
[
{ x:'exp2', y:'user_ops', generator:'array_size_fixnum', operation:'insert', mode:'c', tag:'array_fast', status:'OK' },
{ x:'exp2', y:'user_ops', generator:'hash_size_fixnum', operation:'insert', mode:'c', tag:'suite_insert_one', status:'OK' }
],
'Pending: Array insertion is now as fast as hash insertion.'
],
[ '#array_slow', 'array_nest_fixnum slow versus hash_nest_fixnum insert one C base 2', '', 12, 'generator',
2012-04-16 21:28:48 +00:00
[
{ x:'exp2', y:'user_ops', generator:'array_nest_fixnum', operation:'insert', mode:'c', tag:'suite_insert_one', base:2, status:'OK' },
{ x:'exp2', y:'user_ops', generator:'hash_nest_fixnum', operation:'insert', mode:'c', tag:'suite_insert_one', base:2, status:'OK' }
],
'Nested array insertion is significantly slower than nested hash insertion.'
2012-04-17 13:25:11 +00:00
],
[ '#array_slow', 'array_nest_fixnum fast versus slow insert one C base 2', 'hidden', 12, 'tag',
2012-04-17 13:25:11 +00:00
[
{ x:'exp2', y:'user_ops', generator:'array_nest_fixnum', operation:'insert', mode:'c', tag:'array_fast', base:2 , status:'OK' },
{ x:'exp2', y:'user_ops', generator:'array_nest_fixnum', operation:'insert', mode:'c', tag:'suite_insert_one', base:2, status:'OK' }
],
'Pending: Nested array insertion is now faster.'
2012-04-17 13:25:11 +00:00
],
[ '#array_slow', 'array_nest_fixnum fast versus hash_nest_fixnum insert one C base 2', 'hidden', 12, 'generator',
2012-04-17 13:25:11 +00:00
[
{ x:'exp2', y:'user_ops', generator:'array_nest_fixnum', operation:'insert', mode:'c', tag:'array_fast', base:2 , status:'OK' },
{ x:'exp2', y:'user_ops', generator:'hash_nest_fixnum', operation:'insert', mode:'c', tag:'suite_insert_one', base:2, status:'OK' }
],
'Pending: Nested array insertion is now as fast as nested hash insertion.'
],
[ '#best_practices', 'best practice - hash_size_fixnum insert many fast versus safe for hash size 16', '', 14, 'operation',
[
{ x:'multi_power', y:'user_ops', size:16, generator:'hash_size_fixnum', operation:'insert', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:16, generator:'hash_size_fixnum', operation:'insert_safe', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'real_ops', size:16, generator:'hash_size_fixnum', operation:'insert', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'real_ops', size:16, generator:'hash_size_fixnum', operation:'insert_safe', mode:'c', tag:'suite_insert_many', status:'OK' }
],
'Insert many to ammortize the extra cost of safe mode significantly.'
],
[ '#best_practices', 'best practice - hash_size_fixnum find many with cursor versus find one', '', 12, 'operation',
[
{ x:'exp2', y:'user_ops', generator:'hash_size_fixnum', operation:'find_many', mode:'c', tag:'suite_find', status:'OK' },
{ x:'exp2', y:'user_ops', generator:'hash_size_fixnum', operation:'find_one', mode:'c', tag:'suite_find', status:'OK' },
{ x:'exp2', y:'real_ops', generator:'hash_size_fixnum', operation:'find_many', mode:'c', tag:'suite_find', status:'OK' },
{ x:'exp2', y:'real_ops', generator:'hash_size_fixnum', operation:'find_one', mode:'c', tag:'suite_find', status:'OK' }
],
'Find many with a cursor to out-perform find one significantly.'
],
[ '#insert_many_safe', 'value_string_size insert many safe by multiples (x axis) over a range of data sizes', 'hidden', 14, 'size',
[
{ x:'multi_power', y:'user_ops', size:1, generator:'value_string_size', operation:'insert_safe', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:4, generator:'value_string_size', operation:'insert_safe', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:16, generator:'value_string_size', operation:'insert_safe', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:64, generator:'value_string_size', operation:'insert_safe', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:256, generator:'value_string_size', operation:'insert_safe', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:1024, generator:'value_string_size', operation:'insert_safe', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:4096, generator:'value_string_size', operation:'insert_safe', mode:'c', tag:'suite_insert_many', status:'OK' }
],
''
],
[ '#insert_many_safe', 'key_string_size insert many safe by multiples (x axis) over a range of data sizes', 'hidden', 14, 'size',
[
{ x:'multi_power', y:'user_ops', size:1, generator:'key_string_size', operation:'insert_safe', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:4, generator:'key_string_size', operation:'insert_safe', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:16, generator:'key_string_size', operation:'insert_safe', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:64, generator:'key_string_size', operation:'insert_safe', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:256, generator:'key_string_size', operation:'insert_safe', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:1024, generator:'key_string_size', operation:'insert_safe', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:4096, generator:'key_string_size', operation:'insert_safe', mode:'c', tag:'suite_insert_many', status:'OK' }
],
''
],
[ '#insert_many_safe', 'hash_size_fixnum insert many safe by multiples (x axis) over a range of data sizes', '', 14, 'size',
[
{ x:'multi_power', y:'user_ops', size:1, generator:'hash_size_fixnum', operation:'insert_safe', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:4, generator:'hash_size_fixnum', operation:'insert_safe', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:16, generator:'hash_size_fixnum', operation:'insert_safe', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:64, generator:'hash_size_fixnum', operation:'insert_safe', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:256, generator:'hash_size_fixnum', operation:'insert_safe', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:1024, generator:'hash_size_fixnum', operation:'insert_safe', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:4096, generator:'hash_size_fixnum', operation:'insert_safe', mode:'c', tag:'suite_insert_many', status:'OK' }
],
''
],
[ '#insert_many_safe', 'array_size_fixnum insert many safe by multiples (x axis) over a range of data sizes', 'hidden', 14, 'size',
[
{ x:'multi_power', y:'user_ops', size:1, generator:'array_size_fixnum', operation:'insert_safe', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:4, generator:'array_size_fixnum', operation:'insert_safe', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:16, generator:'array_size_fixnum', operation:'insert_safe', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:64, generator:'array_size_fixnum', operation:'insert_safe', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:256, generator:'array_size_fixnum', operation:'insert_safe', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:1024, generator:'array_size_fixnum', operation:'insert_safe', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:4096, generator:'array_size_fixnum', operation:'insert_safe', mode:'c', tag:'suite_insert_many', status:'OK' }
],
''
],
[ '#insert_many_safe', 'array_nest_fixnum insert many safe by multiples (x axis) over a range of data sizes', 'hidden', 14, 'size',
[
{ x:'multi_power', y:'user_ops', size:1, generator:'array_nest_fixnum', operation:'insert_safe', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:4, generator:'array_nest_fixnum', operation:'insert_safe', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:16, generator:'array_nest_fixnum', operation:'insert_safe', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:64, generator:'array_nest_fixnum', operation:'insert_safe', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:256, generator:'array_nest_fixnum', operation:'insert_safe', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:1024, generator:'array_nest_fixnum', operation:'insert_safe', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:4096, generator:'array_nest_fixnum', operation:'insert_safe', mode:'c', tag:'suite_insert_many', status:'OK' }
],
''
],
[ '#insert_many_safe', 'hash_nest_fixnum insert many safe by multiples (x axis) over a range of data sizes', 'hidden', 14, 'size',
[
{ x:'multi_power', y:'user_ops', size:1, generator:'hash_nest_fixnum', operation:'insert_safe', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:4, generator:'hash_nest_fixnum', operation:'insert_safe', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:16, generator:'hash_nest_fixnum', operation:'insert_safe', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:64, generator:'hash_nest_fixnum', operation:'insert_safe', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:256, generator:'hash_nest_fixnum', operation:'insert_safe', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:1024, generator:'hash_nest_fixnum', operation:'insert_safe', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:4096, generator:'hash_nest_fixnum', operation:'insert_safe', mode:'c', tag:'suite_insert_many', status:'OK' }
],
''
],
[ '#insert_many', 'value_string_size insert many by multiples (x axis) over a range of data sizes', 'hidden', 14, 'size',
[
{ x:'multi_power', y:'user_ops', size:1, generator:'value_string_size', operation:'insert', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:4, generator:'value_string_size', operation:'insert', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:16, generator:'value_string_size', operation:'insert', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:64, generator:'value_string_size', operation:'insert', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:256, generator:'value_string_size', operation:'insert', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:1024, generator:'value_string_size', operation:'insert', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:4096, generator:'value_string_size', operation:'insert', mode:'c', tag:'suite_insert_many', status:'OK' }
],
''
],
[ '#insert_many', 'key_string_size insert many by multiples (x axis) over a range of data sizes', 'hidden', 14, 'size',
[
{ x:'multi_power', y:'user_ops', size:1, generator:'key_string_size', operation:'insert', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:4, generator:'key_string_size', operation:'insert', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:16, generator:'key_string_size', operation:'insert', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:64, generator:'key_string_size', operation:'insert', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:256, generator:'key_string_size', operation:'insert', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:1024, generator:'key_string_size', operation:'insert', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:4096, generator:'key_string_size', operation:'insert', mode:'c', tag:'suite_insert_many', status:'OK' }
],
''
],
[ '#insert_many', 'hash_size_fixnum insert many by multiples (x axis) over a range of data sizes', '', 14, 'size',
[
{ x:'multi_power', y:'user_ops', size:1, generator:'hash_size_fixnum', operation:'insert', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:4, generator:'hash_size_fixnum', operation:'insert', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:16, generator:'hash_size_fixnum', operation:'insert', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:64, generator:'hash_size_fixnum', operation:'insert', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:256, generator:'hash_size_fixnum', operation:'insert', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:1024, generator:'hash_size_fixnum', operation:'insert', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:4096, generator:'hash_size_fixnum', operation:'insert', mode:'c', tag:'suite_insert_many', status:'OK' }
],
''
],
[ '#insert_many', 'array_size_fixnum insert many by multiples (x axis) over a range of data sizes', 'hidden', 14, 'size',
[
{ x:'multi_power', y:'user_ops', size:1, generator:'array_size_fixnum', operation:'insert', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:4, generator:'array_size_fixnum', operation:'insert', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:16, generator:'array_size_fixnum', operation:'insert', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:64, generator:'array_size_fixnum', operation:'insert', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:256, generator:'array_size_fixnum', operation:'insert', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:1024, generator:'array_size_fixnum', operation:'insert', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:4096, generator:'array_size_fixnum', operation:'insert', mode:'c', tag:'suite_insert_many', status:'OK' }
],
''
],
[ '#insert_many', 'array_nest_fixnum insert many by multiples (x axis) over a range of data sizes', 'hidden', 14, 'size',
[
{ x:'multi_power', y:'user_ops', size:1, generator:'array_nest_fixnum', operation:'insert', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:4, generator:'array_nest_fixnum', operation:'insert', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:16, generator:'array_nest_fixnum', operation:'insert', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:64, generator:'array_nest_fixnum', operation:'insert', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:256, generator:'array_nest_fixnum', operation:'insert', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:1024, generator:'array_nest_fixnum', operation:'insert', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:4096, generator:'array_nest_fixnum', operation:'insert', mode:'c', tag:'suite_insert_many', status:'OK' }
],
''
],
[ '#insert_many', 'hash_nest_fixnum insert many by multiples (x axis) over a range of data sizes', 'hidden', 14, 'size',
[
{ x:'multi_power', y:'user_ops', size:1, generator:'hash_nest_fixnum', operation:'insert', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:4, generator:'hash_nest_fixnum', operation:'insert', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:16, generator:'hash_nest_fixnum', operation:'insert', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:64, generator:'hash_nest_fixnum', operation:'insert', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:256, generator:'hash_nest_fixnum', operation:'insert', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:1024, generator:'hash_nest_fixnum', operation:'insert', mode:'c', tag:'suite_insert_many', status:'OK' },
{ x:'multi_power', y:'user_ops', size:4096, generator:'hash_nest_fixnum', operation:'insert', mode:'c', tag:'suite_insert_many', status:'OK' }
],
''
],
[ '#insert_one_safe', 'value_string_size insert one fast versus safe', 'hidden', 14, 'operation',
2012-04-16 21:28:48 +00:00
[
{ x:'exp2', y:'user_ops', generator:'value_string_size', operation:'insert', mode:'c', tag:'suite_insert_one', status:'OK' },
{ x:'exp2', y:'user_ops', generator:'value_string_size', operation:'insert_safe', mode:'c', tag:'suite_insert_one', status:'OK' },
{ x:'exp2', y:'real_ops', generator:'value_string_size', operation:'insert', mode:'c', tag:'suite_insert_one', status:'OK' },
{ x:'exp2', y:'real_ops', generator:'value_string_size', operation:'insert_safe', mode:'c', tag:'suite_insert_one', status:'OK' }
],
''
],
[ '#insert_one_safe', 'key_string_size insert one fast versus safe', 'hidden', 14, 'operation',
2012-04-16 21:28:48 +00:00
[
{ x:'exp2', y:'user_ops', generator:'key_string_size', operation:'insert', mode:'c', tag:'suite_insert_one', status:'OK' },
{ x:'exp2', y:'user_ops', generator:'key_string_size', operation:'insert_safe', mode:'c', tag:'suite_insert_one', status:'OK' },
{ x:'exp2', y:'real_ops', generator:'key_string_size', operation:'insert', mode:'c', tag:'suite_insert_one', status:'OK' },
{ x:'exp2', y:'real_ops', generator:'key_string_size', operation:'insert_safe', mode:'c', tag:'suite_insert_one', status:'OK' }
],
''
],
[ '#insert_one_safe', 'array_size_fixnum insert one fast versus safe', 'hidden', 12, 'operation',
2012-04-16 21:28:48 +00:00
[
{ x:'exp2', y:'user_ops', generator:'array_size_fixnum', operation:'insert', mode:'c', tag:'suite_insert_one', status:'OK' },
{ x:'exp2', y:'user_ops', generator:'array_size_fixnum', operation:'insert_safe', mode:'c', tag:'suite_insert_one', status:'OK' },
{ x:'exp2', y:'real_ops', generator:'array_size_fixnum', operation:'insert', mode:'c', tag:'suite_insert_one', status:'OK' },
{ x:'exp2', y:'real_ops', generator:'array_size_fixnum', operation:'insert_safe', mode:'c', tag:'suite_insert_one', status:'OK' }
],
''
],
[ '#insert_one_safe', 'hash_size_fixnum insert one fast versus safe', '', 12, 'operation',
[
{ x:'exp2', y:'user_ops', generator:'hash_size_fixnum', operation:'insert', mode:'c', tag:'suite_insert_one', status:'OK' },
{ x:'exp2', y:'user_ops', generator:'hash_size_fixnum', operation:'insert_safe', mode:'c', tag:'suite_insert_one', status:'OK' },
{ x:'exp2', y:'real_ops', generator:'hash_size_fixnum', operation:'insert', mode:'c', tag:'suite_insert_one', status:'OK' },
{ x:'exp2', y:'real_ops', generator:'hash_size_fixnum', operation:'insert_safe', mode:'c', tag:'suite_insert_one', status:'OK' }
],
''
],
[ '#insert_one_safe', 'array_nest_fixnum base 2 insert one fast versus safe', 'hidden', 12, 'operation',
[
{ x:'exp2', y:'user_ops', generator:'array_nest_fixnum', operation:'insert', mode:'c', tag:'suite_insert_one', base:2, status:'OK' },
{ x:'exp2', y:'user_ops', generator:'array_nest_fixnum', operation:'insert_safe', mode:'ruby', tag:'suite_insert_one', base:2, status:'OK' },
{ x:'exp2', y:'real_ops', generator:'array_nest_fixnum', operation:'insert', mode:'c', tag:'suite_insert_one', base:2, status:'OK' },
{ x:'exp2', y:'real_ops', generator:'array_nest_fixnum', operation:'insert_safe', mode:'ruby', tag:'suite_insert_one', base:2, status:'OK' }
],
''
],
[ '#insert_one_safe', 'hash_nest_fixnum base 2 insert one fast versus safe', 'hidden', 12, 'operation',
[
{ x:'exp2', y:'user_ops', generator:'hash_nest_fixnum', operation:'insert', mode:'c', tag:'suite_insert_one', base:2, status:'OK' },
{ x:'exp2', y:'user_ops', generator:'hash_nest_fixnum', operation:'insert_safe', mode:'c', tag:'suite_insert_one', base:2, status:'OK' },
{ x:'exp2', y:'real_ops', generator:'hash_nest_fixnum', operation:'insert', mode:'c', tag:'suite_insert_one', base:2, status:'OK' },
{ x:'exp2', y:'real_ops', generator:'hash_nest_fixnum', operation:'insert_safe', mode:'c', tag:'suite_insert_one', base:2, status:'OK' }
],
''
],
[ '#find', 'value_string_size find many with cursor versus find one', 'hidden', 14, 'operation',
[
{ x:'exp2', y:'user_ops', generator:'value_string_size', operation:'find_many', mode:'c', tag:'suite_find', status:'OK' },
{ x:'exp2', y:'user_ops', generator:'value_string_size', operation:'find_one', mode:'c', tag:'suite_find', status:'OK' },
{ x:'exp2', y:'real_ops', generator:'value_string_size', operation:'find_many', mode:'c', tag:'suite_find', status:'OK' },
{ x:'exp2', y:'real_ops', generator:'value_string_size', operation:'find_one', mode:'c', tag:'suite_find', status:'OK' }
],
''
],
[ '#find', 'key_string_size find many with cursor versus find one', 'hidden', 14, 'operation',
[
{ x:'exp2', y:'user_ops', generator:'key_string_size', operation:'find_many', mode:'c', tag:'suite_find', status:'OK' },
{ x:'exp2', y:'user_ops', generator:'key_string_size', operation:'find_one', mode:'c', tag:'suite_find', status:'OK' },
{ x:'exp2', y:'real_ops', generator:'key_string_size', operation:'find_many', mode:'c', tag:'suite_find', status:'OK' },
{ x:'exp2', y:'real_ops', generator:'key_string_size', operation:'find_one', mode:'c', tag:'suite_find', status:'OK' }
],
''
],
[ '#find', 'array_size_fixnum find many with cursor versus find one', 'hidden', 12, 'operation',
[
{ x:'exp2', y:'user_ops', generator:'array_size_fixnum', operation:'find_many', mode:'c', tag:'suite_find', status:'OK' },
{ x:'exp2', y:'user_ops', generator:'array_size_fixnum', operation:'find_one', mode:'c', tag:'suite_find', status:'OK' },
{ x:'exp2', y:'real_ops', generator:'array_size_fixnum', operation:'find_many', mode:'c', tag:'suite_find', status:'OK' },
{ x:'exp2', y:'real_ops', generator:'array_size_fixnum', operation:'find_one', mode:'c', tag:'suite_find', status:'OK' }
],
''
],
[ '#find', 'hash_size_fixnum find many with cursor versus find one', '', 12, 'operation',
[
{ x:'exp2', y:'user_ops', generator:'hash_size_fixnum', operation:'find_many', mode:'c', tag:'suite_find', status:'OK' },
{ x:'exp2', y:'user_ops', generator:'hash_size_fixnum', operation:'find_one', mode:'c', tag:'suite_find', status:'OK' },
{ x:'exp2', y:'real_ops', generator:'hash_size_fixnum', operation:'find_many', mode:'c', tag:'suite_find', status:'OK' },
{ x:'exp2', y:'real_ops', generator:'hash_size_fixnum', operation:'find_one', mode:'c', tag:'suite_find', status:'OK' }
],
''
],
[ '#find', 'array_nest_fixnum base 2 find many with cursor versus find one', 'hidden', 12, 'operation',
[
{ x:'exp2', y:'user_ops', generator:'array_nest_fixnum', operation:'find_many', mode:'c', tag:'suite_find', base:2, status:'OK' },
{ x:'exp2', y:'user_ops', generator:'array_nest_fixnum', operation:'find_one', mode:'c', tag:'suite_find', base:2, status:'OK' },
{ x:'exp2', y:'real_ops', generator:'array_nest_fixnum', operation:'find_many', mode:'c', tag:'suite_find', base:2, status:'OK' },
{ x:'exp2', y:'real_ops', generator:'array_nest_fixnum', operation:'find_one', mode:'c', tag:'suite_find', base:2, status:'OK' }
],
''
],
[ '#find', 'hash_nest_fixnum base 2 find many with cursor versus find one', 'hidden', 12, 'operation',
[
{ x:'exp2', y:'user_ops', generator:'hash_nest_fixnum', operation:'find_many', mode:'c', tag:'suite_find', base:2, status:'OK' },
{ x:'exp2', y:'user_ops', generator:'hash_nest_fixnum', operation:'find_one', mode:'c', tag:'suite_find', base:2, status:'OK' },
{ x:'exp2', y:'real_ops', generator:'hash_nest_fixnum', operation:'find_many', mode:'c', tag:'suite_find', base:2, status:'OK' },
{ x:'exp2', y:'real_ops', generator:'hash_nest_fixnum', operation:'find_one', mode:'c', tag:'suite_find', base:2, status:'OK' }
],
''
],
[ '#c_vs_ruby', 'value_string_size insert one C versus Ruby', 'hidden', 14, 'mode',
[
{ x:'exp2', y:'user_ops', generator:'value_string_size', operation:'insert', mode:'c', tag:'suite_insert_one', status:'OK' },
{ x:'exp2', y:'user_ops', generator:'value_string_size', operation:'insert', mode:'ruby', tag:'suite_insert_one', status:'OK' },
{ x:'exp2', y:'real_ops', generator:'value_string_size', operation:'insert', mode:'c', tag:'suite_insert_one', status:'OK' },
{ x:'exp2', y:'real_ops', generator:'value_string_size', operation:'insert', mode:'ruby', tag:'suite_insert_one', status:'OK' }
],
''
],
[ '#c_vs_ruby', 'key_string_size insert one C versus Ruby', 'hidden', 14, 'mode',
[
{ x:'exp2', y:'user_ops', generator:'key_string_size', operation:'insert', mode:'c', tag:'suite_insert_one', status:'OK' },
{ x:'exp2', y:'user_ops', generator:'key_string_size', operation:'insert', mode:'ruby', tag:'suite_insert_one', status:'OK' },
{ x:'exp2', y:'real_ops', generator:'key_string_size', operation:'insert', mode:'c', tag:'suite_insert_one', status:'OK' },
{ x:'exp2', y:'real_ops', generator:'key_string_size', operation:'insert', mode:'ruby', tag:'suite_insert_one', status:'OK' }
],
''
],
[ '#c_vs_ruby', 'array_size_fixnum insert one C versus Ruby', 'hidden', 12, 'mode',
[
{ x:'exp2', y:'user_ops', generator:'array_size_fixnum', operation:'insert', mode:'c', tag:'suite_insert_one', status:'OK' },
{ x:'exp2', y:'user_ops', generator:'array_size_fixnum', operation:'insert', mode:'ruby', tag:'suite_insert_one', status:'OK' },
{ x:'exp2', y:'real_ops', generator:'array_size_fixnum', operation:'insert', mode:'c', tag:'suite_insert_one', status:'OK' },
{ x:'exp2', y:'real_ops', generator:'array_size_fixnum', operation:'insert', mode:'ruby', tag:'suite_insert_one', status:'OK' }
],
''
],
[ '#c_vs_ruby', 'hash_size_fixnum insert one C versus Ruby', '', 12, 'mode',
[
{ x:'exp2', y:'user_ops', generator:'hash_size_fixnum', operation:'insert', mode:'c', tag:'suite_insert_one', status:'OK' },
{ x:'exp2', y:'user_ops', generator:'hash_size_fixnum', operation:'insert', mode:'ruby', tag:'suite_insert_one', status:'OK' },
{ x:'exp2', y:'real_ops', generator:'hash_size_fixnum', operation:'insert', mode:'c', tag:'suite_insert_one', status:'OK' },
{ x:'exp2', y:'real_ops', generator:'hash_size_fixnum', operation:'insert', mode:'ruby', tag:'suite_insert_one', status:'OK' }
],
''
],
[ '#c_vs_ruby', 'array_nest_fixnum base 2 insert one C versus Ruby', 'hidden', 12, 'mode',
[
{ x:'exp2', y:'user_ops', generator:'array_nest_fixnum', operation:'insert', mode:'c', tag:'suite_insert_one', base:2, status:'OK' },
{ x:'exp2', y:'user_ops', generator:'array_nest_fixnum', operation:'insert', mode:'ruby', tag:'suite_insert_one', base:2, status:'OK' },
{ x:'exp2', y:'real_ops', generator:'array_nest_fixnum', operation:'insert', mode:'c', tag:'suite_insert_one', base:2, status:'OK' },
{ x:'exp2', y:'real_ops', generator:'array_nest_fixnum', operation:'insert', mode:'ruby', tag:'suite_insert_one', base:2, status:'OK' }
],
''
],
[ '#c_vs_ruby', 'hash_nest_fixnum base 2 insert one C versus Ruby', 'hidden', 12, 'mode',
[
{ x:'exp2', y:'user_ops', generator:'hash_nest_fixnum', operation:'insert', mode:'c', tag:'suite_insert_one', base:2, status:'OK' },
{ x:'exp2', y:'user_ops', generator:'hash_nest_fixnum', operation:'insert', mode:'ruby', tag:'suite_insert_one', base:2, status:'OK' },
{ x:'exp2', y:'real_ops', generator:'hash_nest_fixnum', operation:'insert', mode:'c', tag:'suite_insert_one', base:2, status:'OK' },
{ x:'exp2', y:'real_ops', generator:'hash_nest_fixnum', operation:'insert', mode:'ruby', tag:'suite_insert_one', base:2, status:'OK' }
],
''
],
[ '#c_vs_ruby', 'value_string_size find one C versus Ruby', 'hidden', 14, 'mode',
[
{ x:'exp2', y:'user_ops', generator:'value_string_size', operation:'find_one', mode:'c', tag:'suite_find', status:'OK' },
{ x:'exp2', y:'user_ops', generator:'value_string_size', operation:'find_one', mode:'ruby', tag:'suite_find', status:'OK' },
{ x:'exp2', y:'real_ops', generator:'value_string_size', operation:'find_one', mode:'c', tag:'suite_find', status:'OK' },
{ x:'exp2', y:'real_ops', generator:'value_string_size', operation:'find_one', mode:'ruby', tag:'suite_find', status:'OK' }
],
''
],
[ '#c_vs_ruby', 'key_string_size find one C versus Ruby', 'hidden', 14, 'mode',
[
{ x:'exp2', y:'user_ops', generator:'key_string_size', operation:'find_one', mode:'c', tag:'suite_find', status:'OK' },
{ x:'exp2', y:'user_ops', generator:'key_string_size', operation:'find_one', mode:'ruby', tag:'suite_find', status:'OK' },
{ x:'exp2', y:'real_ops', generator:'key_string_size', operation:'find_one', mode:'c', tag:'suite_find', status:'OK' },
{ x:'exp2', y:'real_ops', generator:'key_string_size', operation:'find_one', mode:'ruby', tag:'suite_find', status:'OK' }
],
''
],
[ '#c_vs_ruby', 'array_size_fixnum find one C versus Ruby', 'hidden', 12, 'mode',
[
{ x:'exp2', y:'user_ops', generator:'array_size_fixnum', operation:'find_one', mode:'c', tag:'suite_find', status:'OK' },
{ x:'exp2', y:'user_ops', generator:'array_size_fixnum', operation:'find_one', mode:'ruby', tag:'suite_find', status:'OK' },
{ x:'exp2', y:'real_ops', generator:'array_size_fixnum', operation:'find_one', mode:'c', tag:'suite_find', status:'OK' },
{ x:'exp2', y:'real_ops', generator:'array_size_fixnum', operation:'find_one', mode:'ruby', tag:'suite_find', status:'OK' }
],
''
],
[ '#c_vs_ruby', 'hash_size_fixnum find one C versus Ruby', '', 12, 'mode',
[
{ x:'exp2', y:'user_ops', generator:'hash_size_fixnum', operation:'find_one', mode:'c', tag:'suite_find', status:'OK' },
{ x:'exp2', y:'user_ops', generator:'hash_size_fixnum', operation:'find_one', mode:'ruby', tag:'suite_find', status:'OK' },
{ x:'exp2', y:'real_ops', generator:'hash_size_fixnum', operation:'find_one', mode:'c', tag:'suite_find', status:'OK' },
{ x:'exp2', y:'real_ops', generator:'hash_size_fixnum', operation:'find_one', mode:'ruby', tag:'suite_find', status:'OK' }
],
''
],
[ '#c_vs_ruby', 'array_nest_fixnum base 2 find one C versus Ruby', 'hidden', 12, 'mode',
[
{ x:'exp2', y:'user_ops', generator:'array_nest_fixnum', operation:'find_one', mode:'c', tag:'suite_find', base:2, status:'OK' },
{ x:'exp2', y:'user_ops', generator:'array_nest_fixnum', operation:'find_one', mode:'ruby', tag:'suite_find', base:2, status:'OK' },
{ x:'exp2', y:'real_ops', generator:'array_nest_fixnum', operation:'find_one', mode:'c', tag:'suite_find', base:2, status:'OK' },
{ x:'exp2', y:'real_ops', generator:'array_nest_fixnum', operation:'find_one', mode:'ruby', tag:'suite_find', base:2, status:'OK' }
],
''
],
[ '#c_vs_ruby', 'hash_nest_fixnum base 2 find one C versus Ruby', 'hidden', 12, 'mode',
[
{ x:'exp2', y:'user_ops', generator:'hash_nest_fixnum', operation:'find_one', mode:'c', tag:'suite_find', base:2, status:'OK' },
{ x:'exp2', y:'user_ops', generator:'hash_nest_fixnum', operation:'find_one', mode:'ruby', tag:'suite_find', base:2, status:'OK' },
{ x:'exp2', y:'real_ops', generator:'hash_nest_fixnum', operation:'find_one', mode:'c', tag:'suite_find', base:2, status:'OK' },
{ x:'exp2', y:'real_ops', generator:'hash_nest_fixnum', operation:'find_one', mode:'ruby', tag:'suite_find', base:2, status:'OK' }
],
''
],
[ '#nested', 'array_nest_fixnum insert one C by base', 'hidden', 12, 'base',
[
{ x:'exp2', y:'user_ops', base:2, generator:'array_nest_fixnum', operation:'insert', mode:'c', tag:'suite_insert_one', status:'OK' },
{ x:'exp2', y:'user_ops', base:4, generator:'array_nest_fixnum', operation:'insert', mode:'c', tag:'suite_nest', status:'OK' },
{ x:'exp2', y:'user_ops', base:8, generator:'array_nest_fixnum', operation:'insert', mode:'c', tag:'suite_nest', status:'OK' },
{ x:'exp2', y:'user_ops', base:16, generator:'array_nest_fixnum', operation:'insert', mode:'c', tag:'suite_nest', status:'OK' },
{ x:'exp2', y:'user_ops', base:32, generator:'array_nest_fixnum', operation:'insert', mode:'c', tag:'suite_nest', status:'OK' }
],
''
],
[ '#nested', 'hash_nest_fixnum insert one C by base', 'hidden', 12, 'base',
[
{ x:'exp2', y:'user_ops', base:2, generator:'hash_nest_fixnum', operation:'insert', mode:'c', tag:'suite_insert_one', status:'OK' },
{ x:'exp2', y:'user_ops', base:4, generator:'hash_nest_fixnum', operation:'insert', mode:'c', tag:'suite_nest', status:'OK' },
{ x:'exp2', y:'user_ops', base:8, generator:'hash_nest_fixnum', operation:'insert', mode:'c', tag:'suite_nest', status:'OK' },
{ x:'exp2', y:'user_ops', base:16, generator:'hash_nest_fixnum', operation:'insert', mode:'c', tag:'suite_nest', status:'OK' },
{ x:'exp2', y:'user_ops', base:32, generator:'hash_nest_fixnum', operation:'insert', mode:'c', tag:'suite_nest', status:'OK' }
],
''
],
[ '#nested', 'array_nest_fixnum find one C by base', 'hidden', 12, 'base',
[
{ x:'exp2', y:'user_ops', base:2, generator:'array_nest_fixnum', operation:'find_one', mode:'c', tag:'suite_find', status:'OK' },
{ x:'exp2', y:'user_ops', base:4, generator:'array_nest_fixnum', operation:'find_one', mode:'c', tag:'suite_nest', status:'OK' },
{ x:'exp2', y:'user_ops', base:8, generator:'array_nest_fixnum', operation:'find_one', mode:'c', tag:'suite_nest', status:'OK' },
{ x:'exp2', y:'user_ops', base:16, generator:'array_nest_fixnum', operation:'find_one', mode:'c', tag:'suite_nest', status:'OK' },
{ x:'exp2', y:'user_ops', base:32, generator:'array_nest_fixnum', operation:'find_one', mode:'c', tag:'suite_nest', status:'OK' }
],
''
],
[ '#nested', 'hash_nest_fixnum find one C by base', 'hidden', 12, 'base',
[
{ x:'exp2', y:'user_ops', base:2, generator:'hash_nest_fixnum', operation:'find_one', mode:'c', tag:'suite_find', status:'OK' },
{ x:'exp2', y:'user_ops', base:4, generator:'hash_nest_fixnum', operation:'find_one', mode:'c', tag:'suite_nest', status:'OK' },
{ x:'exp2', y:'user_ops', base:8, generator:'hash_nest_fixnum', operation:'find_one', mode:'c', tag:'suite_nest', status:'OK' },
{ x:'exp2', y:'user_ops', base:16, generator:'hash_nest_fixnum', operation:'find_one', mode:'c', tag:'suite_nest', status:'OK' },
{ x:'exp2', y:'user_ops', base:32, generator:'hash_nest_fixnum', operation:'find_one', mode:'c', tag:'suite_nest', status:'OK' }
],
''
]
];
$.each(graph, function(i, e){
var section, title, classes, xMax, labelSpec, plotLines;
//[section, title, classes, xMax, labelSpec, plotLines, notes] = e;
section = e[0]; title = e[1]; classes = e[2]; xMax = e[3]; labelSpec = e[4]; plotLines = e[5]; notes = e[6];
var series = flotSeries(expSeries, xMax, labelSpec, plotLines);
doPlot(section, title, series, classes, notes);
});
function showTooltip(x, y, contents) {
$('<div id="tooltip">' + contents + '</div>').css( {
position: 'absolute',
display: 'none',
top: y + 5,
left: x + 5,
border: '1px solid #fdd',
padding: '2px',
'background-color': '#fee',
opacity: 0.80
}).appendTo("body").fadeIn(200);
}
var previousPoint = null;
$('.graph').bind('plothover', function (event, pos, item) {
$("#x").text(pos.x.toFixed(2));
$("#y").text(pos.y.toFixed(2));
if (item) {
if (previousPoint != item.dataIndex) {
previousPoint = item.dataIndex;
$("#tooltip").remove();
var x = item.datapoint[0].toFixed(2),
y = item.datapoint[1].toFixed(2);
showTooltip(item.pageX, item.pageY,
item.series.label + ' [ ' + Math.round(x) + ', ' + Math.round(y) + ' ]');
}
}
else {
$("#tooltip").remove();
previousPoint = null;
}
});
$('.show_hide').bind('click', function(event) {
var id = $(this).attr('id').replace(/^show_hide_/, '');
$('#' + id).toggleClass('hidden');
});
$('#show_all').bind('click', function(event) {
for (var i in graph) {
title = graph[i][1];
var id = title.replace(/\W/g,'_');
$('#' + id).removeClass('hidden');
}
});
$('#show_default').bind('click', function(event) {
for (var i in graph) {
title = graph[i][1];
var id = title.replace(/\W/g,'_');
$('#' + id).removeClass('hidden').addClass(graph[i][2]);
}
});
});
</script>
</body>
</html>