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>
String.prototype.repeatify = String.prototype.repeatify || function(num) {
var res = []
if (typeof num === 'number') {
while (num--) {
res.push(this)
}
return res.join('')
}
}
String.prototype.repeatify2 = String.prototype.repeatify2 || function(num) {
var res = ""
if (typeof num === 'number') {
while (num--) {
res += this
}
return res
}
}
String.prototype.repeatify3 = String.prototype.repeatify3 || function(num) {
var res = ""
if (typeof num === 'number') {
while (num--) {
res = res.concat(this)
}
return res
}
}
</script>
var times = 10000000;
var str = 'love';
Ready to run.
Test | Ops/sec | |
---|---|---|
repeatify |
| ready |
repeatify2 |
| ready |
repeatify3 |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.