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
<div id="main" data-bind="template: tmplName"></div>
<script id="templateDummy" type="text/html"></script>
<script id="templateInline" type="text/html">
<table><tbody data-bind="template: { foreach: rows }">
<tr data-bind="template: { foreach: cells }">
<td>xxx</td>
</tr>
</tbody></table>
</script>
<script id="templateMemory" type="text/html">
<table><tbody data-bind="template: { foreach: rows, id: 'templateMRow' }">
<tr data-bind="template: { foreach: cells, id: 'templateMCell' }">
<td>xxx</td>
</tr>
</tbody></table>
</script>
<script id="templateNamed" type="text/html">
<table><tbody data-bind="template: { foreach: rows, name: 'templateRow' }"></tbody></table>
</script>
<script id="templateRow" type="text/html">
<tr data-bind="template: { foreach: cells, name: 'templateCell' }"></tr>
</script>
<script id="templateCell" type="text/html">
<td>xxx</td>
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="http://bestware.us/knockout/named_inline_templates2/knockout-latest.js">
</script>
<script>
function Cell(id) {
this.id = ko.observable(id);
}
function Row(id) {
this.id = ko.observable(id);
this.cells = ko.observableArray();
}
var viewModel = {
tmplName: ko.observable('templateDummy'),
rows: ko.observableArray()
};
for (var i = 0; i < 5; i++) {
var row = new Row(i);
for (var j = 0; j < 5; j++) {
row.cells.push(new Cell(i + " - " + j));
}
viewModel.rows.push(row);
}
var main = $("#main");
ko.applyBindings(viewModel, main[0]);
viewModel.tmplName('templateNamed');
viewModel.tmplName('templateInline');
viewModel.tmplName('templateMemory');
viewModel.tmplName('templateDummy');
</script>
viewModel.tmplName('templateDummy');
Ready to run.
Test | Ops/sec | |
---|---|---|
template named |
| ready |
template inline |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.