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
This is a simple rendering speed test between the most popular libraries/frameworks.
<!-- Jquery -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<script src="https://cdn.jsdelivr.net/knockout/3.2.0/knockout.js"></script>
<!-- Angular -->
<div ng-app>
Angular:
<span ng-controller="Ctrl" id="angList"><span ng-repeat="item in data">{{item}}</span></span>
</div>
<!-- Knockout -->
<div id="koapp">
Knockout:
<span data-bind="foreach: data"><span data-bind="text: $data"></span></span>
</div>
<div id="koappRL">
Knockout:
<span data-bind="foreach: data"><span data-bind="text: $data"></span></span>
</div>
<script>
var Ctrl = function($scope){ $scope.data = []; };
var KOData = ko.observableArray();
var KOviewmodel = {data: KOData};
var ENV = {EXTEND_PROTOTYPES: false};
$(document).ready(function() {
angular.element(document).ready(function() {
var ang_scope = $('#angList').scope();
window.ANGclear = function(){
ang_scope.data = [];
ang_scope.$apply();
};
window.ANGpush = function(data){
ang_scope.data.push(data);
ang_scope.$apply();
};
});
ko.applyBindings(KOviewmodel, document.getElementById('koapp'));
window.KOclear = function (){
KOData.splice(0, KOData().length);
};
window.KOpush = function (data){
KOData.push(data);
};
var KODataRL = ko.observableArray();
KODataRL.extend({ rateLimit: 0 });
var KOviewmodelRL = {data: KODataRL};
ko.applyBindings(KOviewmodelRL, document.getElementById('koappRL'));
window.KOclearRL = function (){
KODataRL.splice(0, KOData().length);
};
window.KOpushRL = function (data){
KODataRL.push(data);
};
});
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
Angular 10 |
| ready |
Knockout 10 |
| ready |
Angular 100 |
| ready |
Knockout 100 |
| ready |
Angular 500 |
| ready |
Knockout 500 |
| ready |
Angular 1000 |
| ready |
Knockout 1000 |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.