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
Benchmarking string methods given in airbnb's style guide
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/3.0.3/handlebars.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script id="test-template" type="text/x-handlebars-template">
This is a super long message about {{person.name.first}}
{{person.name.last}}. A {{person.age}} year old {{person.sex}}
that sets a world record height for {{person.height}} in his
age group of {{person.ageGroup.lower}}-{{person.ageGroup.upper}}
year olds
</script>
var person = {
name: {
first: 'Bob',
last: 'Smith'
},
age: 25,
ageGroup: {
lower: 20,
upper: 30
},
sex: "male",
height: "5' 8\""
};
Ready to run.
Test | Ops/sec | |
---|---|---|
Long string without breaks |
| ready |
Long string without breaks |
| ready |
Long string with concats |
| ready |
Long string with array join (handlebars) |
| ready |
Script tag template (handlebars) |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.