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
Testing performance of different implementations for @rmurpheys challenge for creating and array of tripled string values.
http://gist.github.com/576723
Who said JavaScript OCD?
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script>
// 5: given the following array, create an array that contains the contents of
// each array item repeated three times, with a space between each item. so,
// for example, if an array item is 'foo' then the new array should contain an
// array item 'foo foo foo'. (you can assume the library of your choice is
// available)
var myArray = ['foo', 'bar', 'baz', 'bat', 'batty', 'buzzy', 'booz'];
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
for loop |
| ready |
ES5 - forEach |
| ready |
ES5 - map |
| ready |
jQuery.each |
| ready |
for loop, regexp concat |
| ready |
reverse while (with concat) |
| ready |
reverse while (with join) |
| ready |
fast for |
| ready |
Manual |
| ready |
non-robust join-replace-split |
| ready |
Faster For Loop |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.