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="https://cdnjs.cloudflare.com/ajax/libs/knockout/2.1.0/knockout-min.js"></script>
<ul data-bind="foreach: items">
<li data-bind="text: text">
</li>
</ul>
function ViewModel() {
var self = this;
this.items = ko.observableArray([]);
this.addItems1 = function(items) {
[].push.apply(self.items(), items);
self.items.valueHasMutated();
};
this.addItems2 = function (items) {
self.items.push.apply(self.items, items);
};
}
function Item(text) {
this.text = ko.observable(text);
}
var vm = new ViewModel();
ko.applyBindings(vm);
vm.items([]);
Ready to run.
Test | Ops/sec | |
---|---|---|
ValueHasMutated |
| ready |
push |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.