Skip to content

Instantly share code, notes, and snippets.

@srawlins
Created May 31, 2011 17:55
Show Gist options
  • Save srawlins/1000969 to your computer and use it in GitHub Desktop.
Save srawlins/1000969 to your computer and use it in GitHub Desktop.
Ruby 1.9.2 Bignum performance, when compiled with different GCCs
<html>
<head>
<script type='text/javascript' src='https://www.google.com/jsapi'></script>
<script type='text/javascript'>
google.load('visualization', '1', {packages:['corechart']});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data_bench_right_shift = new google.visualization.DataTable();
data_bench_right_shift.addColumn('string', 'Bench');
data_bench_right_shift.addColumn('number', 'ruby-1.9.2-p180-gcc460');
data_bench_right_shift.addColumn('number', 'ruby-1.9.2-p180-gcc453');
data_bench_right_shift.addColumn('number', 'ruby-1.9.2-p180');
data_bench_right_shift.addRows(12);
data_bench_right_shift.setValue(0, 0, 'right shift by 1');
data_bench_right_shift.setValue(0, 1, 7831836);
data_bench_right_shift.setValue(0, 2, 6404376);
data_bench_right_shift.setValue(0, 3, 5315626);
data_bench_right_shift.setValue(1, 0, 'right shift by 8');
data_bench_right_shift.setValue(1, 1, 7832380);
data_bench_right_shift.setValue(1, 2, 6394093);
data_bench_right_shift.setValue(1, 3, 5320532);
data_bench_right_shift.setValue(2, 0, 'right shift by 16');
data_bench_right_shift.setValue(2, 1, 7217212);
data_bench_right_shift.setValue(2, 2, 6064454);
data_bench_right_shift.setValue(2, 3, 5107827);
data_bench_right_shift.setValue(3, 0, 'right shift by 32');
data_bench_right_shift.setValue(3, 1, 7701810);
data_bench_right_shift.setValue(3, 2, 6237510);
data_bench_right_shift.setValue(3, 3, 5230190);
data_bench_right_shift.setValue(4, 0, 'right shift by 64');
data_bench_right_shift.setValue(4, 1, 7791525);
data_bench_right_shift.setValue(4, 2, 6237133);
data_bench_right_shift.setValue(4, 3, 5320927);
var chart_bench_right_shift = new google.visualization.ColumnChart(document.getElementById('chart_bench_right_shift'));
chart_bench_right_shift.draw(data_bench_right_shift, {width: 900, height: 540, title: 'Bench right shift',
hAxis: {title: 'Bench', titleTextStyle: {color: 'red'}},
chartArea: {width: 500},
vAxis: {baseline: 0}
});
var data_bench_div = new google.visualization.DataTable();
data_bench_div.addColumn('string', 'Bench');
data_bench_div.addColumn('number', 'ruby-1.9.2-p180-gcc460');
data_bench_div.addColumn('number', 'ruby-1.9.2-p180-gcc453');
data_bench_div.addColumn('number', 'ruby-1.9.2-p180');
data_bench_div.addRows(12);
data_bench_div.setValue(0, 0, 'medium Bignum / small Bignum');
data_bench_div.setValue(0, 1, 1001760);
data_bench_div.setValue(0, 2, 991175);
data_bench_div.setValue(0, 3, 962541);
data_bench_div.setValue(1, 0, 'large Bignum / medium Bignum');
data_bench_div.setValue(1, 1, 62714);
data_bench_div.setValue(1, 2, 62602);
data_bench_div.setValue(1, 3, 58381);
data_bench_div.setValue(2, 0, 'Bignum / Fixnum => Bignum');
data_bench_div.setValue(2, 1, 850844);
data_bench_div.setValue(2, 2, 831898);
data_bench_div.setValue(2, 3, 829912);
data_bench_div.setValue(3, 0, 'Bignum / Fixnum => Fixnum');
data_bench_div.setValue(3, 1, 2437505);
data_bench_div.setValue(3, 2, 2293979);
data_bench_div.setValue(3, 3, 2268331);
data_bench_div.setValue(4, 0, 'Bignum / Float');
data_bench_div.setValue(4, 1, 6862691);
data_bench_div.setValue(4, 2, 6493963);
data_bench_div.setValue(4, 3, 5519349);
var chart_bench_div = new google.visualization.ColumnChart(document.getElementById('chart_bench_div'));
chart_bench_div.draw(data_bench_div, {width: 900, height: 540, title: 'Bench div',
hAxis: {title: 'Bench', titleTextStyle: {color: 'red'}},
chartArea: {width: 500},
vAxis: {baseline: 0}
});
var data_bench_sub = new google.visualization.DataTable();
data_bench_sub.addColumn('string', 'Bench');
data_bench_sub.addColumn('number', 'ruby-1.9.2-p180-gcc460');
data_bench_sub.addColumn('number', 'ruby-1.9.2-p180-gcc453');
data_bench_sub.addColumn('number', 'ruby-1.9.2-p180');
data_bench_sub.addRows(12);
data_bench_sub.setValue(0, 0, 'medium Bignum - small Bignum');
data_bench_sub.setValue(0, 1, 4226293);
data_bench_sub.setValue(0, 2, 4055272);
data_bench_sub.setValue(0, 3, 3848269);
data_bench_sub.setValue(1, 0, 'large Bignum - medium Bignum');
data_bench_sub.setValue(1, 1, 2047151);
data_bench_sub.setValue(1, 2, 2031191);
data_bench_sub.setValue(1, 3, 1250673);
data_bench_sub.setValue(2, 0, 'Bignum - Fixnum => Bignum');
data_bench_sub.setValue(2, 1, 4525883);
data_bench_sub.setValue(2, 2, 4136479);
data_bench_sub.setValue(2, 3, 4064637);
data_bench_sub.setValue(3, 0, 'Bignum - Fixnum => Fixnum');
data_bench_sub.setValue(3, 1, 7647470);
data_bench_sub.setValue(3, 2, 6653682);
data_bench_sub.setValue(3, 3, 6398956);
data_bench_sub.setValue(4, 0, 'Bignum - Float');
data_bench_sub.setValue(4, 1, 6973478);
data_bench_sub.setValue(4, 2, 6585560);
data_bench_sub.setValue(4, 3, 6022412);
var chart_bench_sub = new google.visualization.ColumnChart(document.getElementById('chart_bench_sub'));
chart_bench_sub.draw(data_bench_sub, {width: 900, height: 540, title: 'Bench sub',
hAxis: {title: 'Bench', titleTextStyle: {color: 'red'}},
chartArea: {width: 500},
vAxis: {baseline: 0}
});
var data_bench_cmp = new google.visualization.DataTable();
data_bench_cmp.addColumn('string', 'Bench');
data_bench_cmp.addColumn('number', 'ruby-1.9.2-p180-gcc453');
data_bench_cmp.addColumn('number', 'ruby-1.9.2-p180-gcc460');
data_bench_cmp.addColumn('number', 'ruby-1.9.2-p180');
data_bench_cmp.addRows(12);
data_bench_cmp.setValue(0, 0, 'medium Bignum <=> Bignum');
data_bench_cmp.setValue(0, 1, 14959442);
data_bench_cmp.setValue(0, 2, 14945889);
data_bench_cmp.setValue(0, 3, 12116039);
data_bench_cmp.setValue(1, 0, 'large Bignum <=> Bignum');
data_bench_cmp.setValue(1, 1, 15156422);
data_bench_cmp.setValue(1, 2, 15030870);
data_bench_cmp.setValue(1, 3, 11737893);
data_bench_cmp.setValue(2, 0, 'Bignum <=> Fixnum');
data_bench_cmp.setValue(2, 1, 8971169);
data_bench_cmp.setValue(2, 2, 8833045);
data_bench_cmp.setValue(2, 3, 7810890);
data_bench_cmp.setValue(3, 0, 'Bignum <=> Float');
data_bench_cmp.setValue(3, 1, 8826334);
data_bench_cmp.setValue(3, 2, 8569199);
data_bench_cmp.setValue(3, 3, 7785785);
var chart_bench_cmp = new google.visualization.ColumnChart(document.getElementById('chart_bench_cmp'));
chart_bench_cmp.draw(data_bench_cmp, {width: 900, height: 540, title: 'Bench cmp',
hAxis: {title: 'Bench', titleTextStyle: {color: 'red'}},
chartArea: {width: 500},
vAxis: {baseline: 0}
});
var data_bench_lt = new google.visualization.DataTable();
data_bench_lt.addColumn('string', 'Bench');
data_bench_lt.addColumn('number', 'ruby-1.9.2-p180-gcc453');
data_bench_lt.addColumn('number', 'ruby-1.9.2-p180-gcc460');
data_bench_lt.addColumn('number', 'ruby-1.9.2-p180');
data_bench_lt.addRows(12);
data_bench_lt.setValue(0, 0, 'medium Bignum < Bignum');
data_bench_lt.setValue(0, 1, 13520635);
data_bench_lt.setValue(0, 2, 12606541);
data_bench_lt.setValue(0, 3, 10966826);
data_bench_lt.setValue(1, 0, 'large Bignum < Bignum');
data_bench_lt.setValue(1, 1, 13458493);
data_bench_lt.setValue(1, 2, 13023529);
data_bench_lt.setValue(1, 3, 10971076);
data_bench_lt.setValue(2, 0, 'Bignum < Fixnum');
data_bench_lt.setValue(2, 1, 8607256);
data_bench_lt.setValue(2, 2, 8120461);
data_bench_lt.setValue(2, 3, 7459911);
data_bench_lt.setValue(3, 0, 'Bignum < Float');
data_bench_lt.setValue(3, 1, 8450089);
data_bench_lt.setValue(3, 2, 7893918);
data_bench_lt.setValue(3, 3, 7239268);
var chart_bench_lt = new google.visualization.ColumnChart(document.getElementById('chart_bench_lt'));
chart_bench_lt.draw(data_bench_lt, {width: 900, height: 540, title: 'Bench lt',
hAxis: {title: 'Bench', titleTextStyle: {color: 'red'}},
chartArea: {width: 500},
vAxis: {baseline: 0}
});
var data_bench_ge = new google.visualization.DataTable();
data_bench_ge.addColumn('string', 'Bench');
data_bench_ge.addColumn('number', 'ruby-1.9.2-p180-gcc453');
data_bench_ge.addColumn('number', 'ruby-1.9.2-p180-gcc460');
data_bench_ge.addColumn('number', 'ruby-1.9.2-p180');
data_bench_ge.addRows(12);
data_bench_ge.setValue(0, 0, 'medium Bignum >= Bignum');
data_bench_ge.setValue(0, 1, 13380258);
data_bench_ge.setValue(0, 2, 12814053);
data_bench_ge.setValue(0, 3, 10885203);
data_bench_ge.setValue(1, 0, 'large Bignum >= Bignum');
data_bench_ge.setValue(1, 1, 13346079);
data_bench_ge.setValue(1, 2, 12930748);
data_bench_ge.setValue(1, 3, 10958570);
data_bench_ge.setValue(2, 0, 'Bignum >= Fixnum');
data_bench_ge.setValue(2, 1, 8448416);
data_bench_ge.setValue(2, 2, 8053476);
data_bench_ge.setValue(2, 3, 7540451);
data_bench_ge.setValue(3, 0, 'Bignum >= Float');
data_bench_ge.setValue(3, 1, 8438830);
data_bench_ge.setValue(3, 2, 7962645);
data_bench_ge.setValue(3, 3, 7368030);
var chart_bench_ge = new google.visualization.ColumnChart(document.getElementById('chart_bench_ge'));
chart_bench_ge.draw(data_bench_ge, {width: 900, height: 540, title: 'Bench ge',
hAxis: {title: 'Bench', titleTextStyle: {color: 'red'}},
chartArea: {width: 500},
vAxis: {baseline: 0}
});
var data_bench_gt = new google.visualization.DataTable();
data_bench_gt.addColumn('string', 'Bench');
data_bench_gt.addColumn('number', 'ruby-1.9.2-p180-gcc453');
data_bench_gt.addColumn('number', 'ruby-1.9.2-p180-gcc460');
data_bench_gt.addColumn('number', 'ruby-1.9.2-p180');
data_bench_gt.addRows(12);
data_bench_gt.setValue(0, 0, 'medium Bignum > Bignum');
data_bench_gt.setValue(0, 1, 13456964);
data_bench_gt.setValue(0, 2, 12690208);
data_bench_gt.setValue(0, 3, 10645672);
data_bench_gt.setValue(1, 0, 'large Bignum > Bignum');
data_bench_gt.setValue(1, 1, 13451435);
data_bench_gt.setValue(1, 2, 12972953);
data_bench_gt.setValue(1, 3, 10668737);
data_bench_gt.setValue(2, 0, 'Bignum > Fixnum');
data_bench_gt.setValue(2, 1, 8584397);
data_bench_gt.setValue(2, 2, 8158449);
data_bench_gt.setValue(2, 3, 7544707);
data_bench_gt.setValue(3, 0, 'Bignum > Float');
data_bench_gt.setValue(3, 1, 8471574);
data_bench_gt.setValue(3, 2, 7884166);
data_bench_gt.setValue(3, 3, 7161556);
var chart_bench_gt = new google.visualization.ColumnChart(document.getElementById('chart_bench_gt'));
chart_bench_gt.draw(data_bench_gt, {width: 900, height: 540, title: 'Bench gt',
hAxis: {title: 'Bench', titleTextStyle: {color: 'red'}},
chartArea: {width: 500},
vAxis: {baseline: 0}
});
var data_bench_pow = new google.visualization.DataTable();
data_bench_pow.addColumn('string', 'Bench');
data_bench_pow.addColumn('number', 'ruby-1.9.2-p180-gcc453');
data_bench_pow.addColumn('number', 'ruby-1.9.2-p180-gcc460');
data_bench_pow.addColumn('number', 'ruby-1.9.2-p180');
data_bench_pow.addRows(12);
data_bench_pow.setValue(0, 0, 'Bignum ** Fixnum');
data_bench_pow.setValue(0, 1, 882921);
data_bench_pow.setValue(0, 2, 812392);
data_bench_pow.setValue(0, 3, 729251);
data_bench_pow.setValue(1, 0, 'Bignum ** Float');
data_bench_pow.setValue(1, 1, 4855844);
data_bench_pow.setValue(1, 2, 4824538);
data_bench_pow.setValue(1, 3, 4458318);
var chart_bench_pow = new google.visualization.ColumnChart(document.getElementById('chart_bench_pow'));
chart_bench_pow.draw(data_bench_pow, {width: 900, height: 540, title: 'Bench pow',
hAxis: {title: 'Bench', titleTextStyle: {color: 'red'}},
chartArea: {width: 500},
vAxis: {baseline: 0}
});
var data_bench_le = new google.visualization.DataTable();
data_bench_le.addColumn('string', 'Bench');
data_bench_le.addColumn('number', 'ruby-1.9.2-p180-gcc453');
data_bench_le.addColumn('number', 'ruby-1.9.2-p180-gcc460');
data_bench_le.addColumn('number', 'ruby-1.9.2-p180');
data_bench_le.addRows(12);
data_bench_le.setValue(0, 0, 'medium Bignum <= Bignum');
data_bench_le.setValue(0, 1, 13160273);
data_bench_le.setValue(0, 2, 12568848);
data_bench_le.setValue(0, 3, 10706695);
data_bench_le.setValue(1, 0, 'large Bignum <= Bignum');
data_bench_le.setValue(1, 1, 13463809);
data_bench_le.setValue(1, 2, 12628141);
data_bench_le.setValue(1, 3, 10567997);
data_bench_le.setValue(2, 0, 'Bignum <= Fixnum');
data_bench_le.setValue(2, 1, 8520243);
data_bench_le.setValue(2, 2, 8113875);
data_bench_le.setValue(2, 3, 7536661);
data_bench_le.setValue(3, 0, 'Bignum <= Float');
data_bench_le.setValue(3, 1, 8477488);
data_bench_le.setValue(3, 2, 7879717);
data_bench_le.setValue(3, 3, 7300475);
var chart_bench_le = new google.visualization.ColumnChart(document.getElementById('chart_bench_le'));
chart_bench_le.draw(data_bench_le, {width: 900, height: 540, title: 'Bench le',
hAxis: {title: 'Bench', titleTextStyle: {color: 'red'}},
chartArea: {width: 500},
vAxis: {baseline: 0}
});
var data_bench_left_shift = new google.visualization.DataTable();
data_bench_left_shift.addColumn('string', 'Bench');
data_bench_left_shift.addColumn('number', 'ruby-1.9.2-p180-gcc460');
data_bench_left_shift.addColumn('number', 'ruby-1.9.2-p180-gcc453');
data_bench_left_shift.addColumn('number', 'ruby-1.9.2-p180');
data_bench_left_shift.addRows(12);
data_bench_left_shift.setValue(0, 0, 'left shift by 1');
data_bench_left_shift.setValue(0, 1, 8726781);
data_bench_left_shift.setValue(0, 2, 6576618);
data_bench_left_shift.setValue(0, 3, 5905333);
data_bench_left_shift.setValue(1, 0, 'left shift by 8');
data_bench_left_shift.setValue(1, 1, 8603179);
data_bench_left_shift.setValue(1, 2, 6492051);
data_bench_left_shift.setValue(1, 3, 5942649);
data_bench_left_shift.setValue(2, 0, 'left shift by 16');
data_bench_left_shift.setValue(2, 1, 8591908);
data_bench_left_shift.setValue(2, 2, 6496009);
data_bench_left_shift.setValue(2, 3, 5921599);
data_bench_left_shift.setValue(3, 0, 'left shift by 32');
data_bench_left_shift.setValue(3, 1, 7758285);
data_bench_left_shift.setValue(3, 2, 6258374);
data_bench_left_shift.setValue(3, 3, 5495134);
data_bench_left_shift.setValue(4, 0, 'left shift by 64');
data_bench_left_shift.setValue(4, 1, 7664207);
data_bench_left_shift.setValue(4, 2, 6160673);
data_bench_left_shift.setValue(4, 3, 5515484);
var chart_bench_left_shift = new google.visualization.ColumnChart(document.getElementById('chart_bench_left_shift'));
chart_bench_left_shift.draw(data_bench_left_shift, {width: 900, height: 540, title: 'Bench left shift',
hAxis: {title: 'Bench', titleTextStyle: {color: 'red'}},
chartArea: {width: 500},
vAxis: {baseline: 0}
});
var data_bench_add = new google.visualization.DataTable();
data_bench_add.addColumn('string', 'Bench');
data_bench_add.addColumn('number', 'ruby-1.9.2-p180-gcc460');
data_bench_add.addColumn('number', 'ruby-1.9.2-p180');
data_bench_add.addColumn('number', 'ruby-1.9.2-p180-gcc453');
data_bench_add.addRows(12);
data_bench_add.setValue(0, 0, 'small Bignum + Bignum');
data_bench_add.setValue(0, 1, 7173552);
data_bench_add.setValue(0, 2, 6461548);
data_bench_add.setValue(0, 3, 6019269);
data_bench_add.setValue(1, 0, 'medium Bignum + Bignum');
data_bench_add.setValue(1, 1, 3484686);
data_bench_add.setValue(1, 2, 3382583);
data_bench_add.setValue(1, 3, 3356065);
data_bench_add.setValue(2, 0, 'large Bignum + Bignum');
data_bench_add.setValue(2, 1, 1445519);
data_bench_add.setValue(2, 2, 1412375);
data_bench_add.setValue(2, 3, 1283590);
data_bench_add.setValue(3, 0, 'Bignum + Fixnum');
data_bench_add.setValue(3, 1, 3748089);
data_bench_add.setValue(3, 2, 3724436);
data_bench_add.setValue(3, 3, 3674006);
data_bench_add.setValue(4, 0, 'Bignum + Float');
data_bench_add.setValue(4, 1, 7249091);
data_bench_add.setValue(4, 2, 6960124);
data_bench_add.setValue(4, 3, 6563332);
var chart_bench_add = new google.visualization.ColumnChart(document.getElementById('chart_bench_add'));
chart_bench_add.draw(data_bench_add, {width: 900, height: 540, title: 'Bench add',
hAxis: {title: 'Bench', titleTextStyle: {color: 'red'}},
chartArea: {width: 500},
vAxis: {baseline: 0}
});
var data_bench_eql = new google.visualization.DataTable();
data_bench_eql.addColumn('string', 'Bench');
data_bench_eql.addColumn('number', 'ruby-1.9.2-p180-gcc460');
data_bench_eql.addColumn('number', 'ruby-1.9.2-p180-gcc453');
data_bench_eql.addColumn('number', 'ruby-1.9.2-p180');
data_bench_eql.addRows(12);
data_bench_eql.setValue(0, 0, 'medium Bignum == Bignum');
data_bench_eql.setValue(0, 1, 15037101);
data_bench_eql.setValue(0, 2, 14962053);
data_bench_eql.setValue(0, 3, 11903217);
data_bench_eql.setValue(1, 0, 'large Bignum == Bignum');
data_bench_eql.setValue(1, 1, 14899424);
data_bench_eql.setValue(1, 2, 14490302);
data_bench_eql.setValue(1, 3, 11917538);
data_bench_eql.setValue(2, 0, 'Bignum == Fixnum');
data_bench_eql.setValue(2, 1, 8821081);
data_bench_eql.setValue(2, 2, 8303640);
data_bench_eql.setValue(2, 3, 7038796);
data_bench_eql.setValue(3, 0, 'Bignum == Float');
data_bench_eql.setValue(3, 1, 9549289);
data_bench_eql.setValue(3, 2, 8827395);
data_bench_eql.setValue(3, 3, 8040639);
var chart_bench_eql = new google.visualization.ColumnChart(document.getElementById('chart_bench_eql'));
chart_bench_eql.draw(data_bench_eql, {width: 900, height: 540, title: 'Bench eql',
hAxis: {title: 'Bench', titleTextStyle: {color: 'red'}},
chartArea: {width: 500},
vAxis: {baseline: 0}
});
}
</script>
</head>
<body>
<div id='chart_bench_right_shift'></div>
<div id='chart_bench_div'></div>
<div id='chart_bench_sub'></div>
<div id='chart_bench_cmp'></div>
<div id='chart_bench_lt'></div>
<div id='chart_bench_ge'></div>
<div id='chart_bench_gt'></div>
<div id='chart_bench_pow'></div>
<div id='chart_bench_le'></div>
<div id='chart_bench_left_shift'></div>
<div id='chart_bench_add'></div>
<div id='chart_bench_eql'></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment