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">
</script>
<script src="//ajax.aspnetcdn.com/ajax/knockout/knockout-2.2.1.js">
</script>
<script src="//rawgithub.com/mbest/knockout-repeat/master/knockout-repeat.js">
</script>
<div id="main" style="display: none">
</div>
<script id="template" type="text/html">
< table data - bind = "template: { foreach: rows }" > < tr data - bind = "template: { foreach: cells }" > < td data - bind = "text: 'Cell ' + id()" > < /td>
</tr > < /table>
</script>
<script id="repeat" type="text/html">
< table > < tr data - bind = "repeat: { foreach: rows, item: '$row' }" > < td data - bind = "repeat: { foreach: $row().cells, item: '$cell', bind: 'text: \'Cell \' + $cell().id()'}" > < /td>
</tr > < /table>
</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 < 10; 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>
ko.removeNode($("#main")[0]);
Ready to run.
Test | Ops/sec | |
---|---|---|
repeat |
| ready |
template |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.