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="testCase1" data-bind="foreach: items1">
<tr data-bind="foreach: columns">
<td data-bind="text: $data"/>
</tr>
</table>
<table id="testCase2" data-bind="foreach: items2">
<tr>
<td data-bind="text: columns[0]"/>
<td data-bind="text: columns[1]"/>
<td data-bind="text: columns[2]"/>
<td data-bind="text: columns[3]"/>
<td data-bind="text: columns[4]"/>
<td data-bind="text: columns[5]"/>
<td data-bind="text: columns[6]"/>
<td data-bind="text: columns[7]"/>
<td data-bind="text: columns[8]"/>
<td data-bind="text: columns[9]"/>
</tr>
</table>
<script src="http://ajax.aspnetcdn.com/ajax/knockout/knockout-3.0.0.js"></script>
<script>
var model = {
items1: ko.observable([]),
items2: ko.observable([])
};
var items = [];
for (var i = 0; i < 10; i++) {
var item = { columns : [] };
for (var j = 0; j < 10; j++) {
item.columns.push(i.toString() + ":" + j.toString());
}
items.push(item);
}
ko.applyBindings(model);
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
Nested foreach |
| ready |
Expanded loop markup |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.