jsPerf.app is an online JavaScript performance benchmark test runner & jsperf.com mirror. It is a complete rewrite in homage to the once excellent jsperf.com now with hopefully a more modern & maintainable codebase.
jsperf.com URLs are mirrored at the same path, e.g:
https://jsperf.com/negative-modulo/2
Can be accessed at:
https://jsperf.app/negative-modulo/2
<script>
var count = 100;
var real = "";
for(var i=0; i<count;i++) {
real += '\nthis[\'f'+i+'\'] = \'' + (i%2 ? 'node' : 'postgres') +'\';'
}
var fnbody = "return {";
for(var i=0; i<count;i++) {
fnbody += '\n\'f'+i+'\':\'' + (i%2 ? 'node' : 'postgres') +'\','
}
fnbody.trim(',');
fnbody += '}';
var ctorbody = ""
for(var i=0; i<count;i++) {
ctorbody += '\nrow[\'f'+i+'\'] = \'' + (i%2 ? 'node' : 'postgres') +'\';'
}
ctorbody.trim('\n return row;');
var ctor1 = new Function("row", ctorbody);
var ctor2 = new Function(fnbody);
var realctor = new Function(real);
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
new |
| ready |
ctor1 |
| ready |
ctor2 |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.