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
Per the original tests, without the native comparison.
<!-- Jquery -->
<script src="http://code.jquery.com/jquery-2.1.4.min.js"></script>
jQuery:
<div id="jq_test"></div>
<script>
var jqEl = $('#jq_test');
var children = '';
var jqPush = function (data) {
children += '<span>' + data + '</span>';
}
var jqRender = function () {
jqEl.html(children);
}
var jqRenderAppend = function () {
jqEl.append(children);
}
var jqClear = function () {
jqEl.empty();
children = '';
}
</script>
<!-- Angular -->
<div ng-app="app">
Angular:
<div ng-controller="Ctrl" id="angList"><span ng-repeat="item in data">{{item}}</span></div>
</div>
<script src="http://code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.0/angular.min.js"></script>
<script>
angular.module('app', [])
.controller('Ctrl',
function($scope){
$scope.data = [];
});
angular.element(document).ready(function() {
var angScope = angular.element('#angList').scope();
window.angularClear = function(){
angScope.data.splice(0, angScope.data.length);
};
window.angularPush = function(data){
angScope.data.push(data);
};
window.angularApply = function(data){
angScope.$apply();
};
});
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
Angular |
| ready |
jQuery html() |
| ready |
jQuery append() |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.