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
Updated the existing fiddle to use knockout batch updates
<!-- Jquery -->
<script src="https://code.jquery.com/jquery-1.9.1.min.js">
</script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.4/angular.min.js">
</script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/knockout/3.0.0/knockout-min.js">
</script>
<script src="https://canjs.us/release/2.0.3/can.jquery.js"></script>
<!-- CanJS -->
<div id="canapp">
<h3>Can</h3>
<div >
<script type="text/ejs" id="canEJS">
<% items.each(function(item) { %>
<span><%= item %></span>
<% } ) %>
</script>
</div>
</div>
<!-- Knockout -->
<div id="koapp">
<h3>KO</h3>
<span data-bind="foreach: items" >
<span data-bind="text: $data"></span>
</span>
</div>
<!-- Angular -->
<div ng-app="ANGAPP" id="angapp" ng-controller="Ctrl">
<h3>Angular</h3>
<span ng-repeat="item in items" ">{{item}}</span>
</div>
<script>
// Angular
angular.module('ANGAPP', [])
.controller('Ctrl', function($scope) {
$scope.items = [];
window.ANG = {
clear: function() {
$scope.items.splice(0);
$scope.$digest();
},
push: function(item) {
$scope.items.push(item);
$scope.$digest();
}
};
});
// KO
var ko_items = ko.observableArray([]);
var ko_viewmodel = {items: ko_items};
ko.applyBindings(ko_viewmodel, document.getElementById('koapp'));
window.KO = {
clear: function() {
ko_items([]);
},
push: function(data) {
ko_items(data);
}
}
//CanJS
var can_items = new can.Observe.List([]);
$('#canapp')
.append(can.view('canEJS', {items: can_items}));
window.CAN = {
clear: function () {
can_items.splice(0);
},
push: function (item) {
can_items.push(item);
}
}
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
Can |
| ready |
Knockout |
| ready |
Angular |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.