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/jquery/1/jquery.min.js" type="text/javascript"></script>
<script src="http://github.com/trix/nano/raw/master/jquery.nano.js" type="text/javascript"></script>
<script>
var tmpl = '<div class="head"><span class="left">{left}</span><span class="right">{right}</span><span class="left">{left}</span><span class="right">{right}</span></div>';
var data = {
left: "abracadabra",
right: "asfpqwer qwoe rk"
};
function pico(template, data) {
return template.replace(/\{(\w*)\}/g, function(str, key) {
return data[key];
});
}
function pic(template) {
template = template.replace(/[\n'\\]/g, '\\$&');
template = template.replace(/\{(\w*)\}/g, function(str, key) {
return "'+d['" + key + "']+'";
});
return new Function("d", "return '" + template + "'");
}
var tmpl_pic = pic(tmpl);
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
Nano |
| ready |
Pico |
| ready |
Pic |
| ready |
String append |
| ready |
Array join |
| ready |
String append (using with) |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.