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
Performance comparison between Handlebars 1.2.1, 1.3.0, 2.0
<script>
var root = window;
</script>
<script src="//cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.2.1/handlebars.min.js"></script>
<script>
var HB121 = Handlebars;
delete window.Handlebars;
</script>
<script src="//cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.3.0/handlebars.min.js"></script>
<script>
var HB130 = Handlebars;
delete window.Handlebars;
</script>
<script src="//cdnjs.cloudflare.com/ajax/libs/handlebars.js/2.0.0/handlebars.min.js"></script>
<script>
var HB200_a4 = Handlebars;
delete window.Handlebars;
</script>
var template = 'Hello {{name}}! You have {{mailCount}} new e-mails. Go back to {{page}} {{#each list}} {{number}} {{/each}} {{#if mailCount}}{{mailCount}}{{/if}}';
var data = {
name: 'Eneko',
mailCount: 5,
page: 'Main page',
list: []
};
for (var i = 0; i < 500; i++) {
data.list.push({
"number": i
});
}
// Precompile
var compiledHbs121 = HB121.compile(template);
var compiledHbs130 = HB130.compile(template);
var compiledHbs200_a4 = HB200_a4.compile(template);
Ready to run.
Test | Ops/sec | |
---|---|---|
Handlebars 1.2.1 |
| ready |
Handlebars 1.3.0 |
| ready |
Handlebars 2.0.0 |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.