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 src="//ajax.googleapis.com/ajax/libs/dojo/1/dojo/dojo.xd.js"></script>
<script>
string="this is a {0}. This is another {1}";
arr=['test1','test2'];
manualReplace= function(messageString, parameterArray) {
var newString = messageString;
for(var i=0; i<parameterArray.length; i++) {
var exp = '{' + i + '}';
newString = newString.replace(exp,parameterArray[i]);
}
return newString;
}
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
dojo.replace |
| ready |
manual replace |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.