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
<table id="main"></table>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="https://github.com/jquery/jquery-tmpl/blob/master/jquery.tmpl.js">
</script>
<script src="https://github.com/SteveSanderson/knockout/raw/master/build/output/knockout-latest.debug.js">
</script>
<script id="rowTmpl" type="text/html">
<tr data-bind="template: { name: 'cellTmpl', foreach: cells }"></tr>
</script>
<script id="cellTmpl" type="text/html">
<td data-bind="text: 'Cell ' + id()"></td>
</script>
<script id="jqTmpl" type="text/html">
{{each rows}}
<tr>
{{each cells}}
<td>Cell ${id}</td>
{{/each}}
</tr>
{{/each}}
</script>
<script>
function Cell(id) {
this.id = ko.observable(id);
}
function Row(id) {
this.id = ko.observable(id);
this.cells = ko.observableArray();
}
var viewModel = {
rows: ko.observableArray()
};
for (var i = 0; i < 100; i++) {
var row = new Row(i);
for (var j = 0; j < 10; j++) {
row.cells.push(new Cell(i + " - " + j));
}
viewModel.rows.push(row);
}
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
jquery template plugin (no data-bind) |
| ready |
jquery template plugin |
| ready |
KO native templating |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.