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.
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.4/angular.min.js"></script>
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.0.1/ember-template-compiler.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.0.1/ember.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.13.3/react.js"></script>
<!-- Angular -->
<script>
var ngApp = angular.module('app',[]);
var Ctrl = function($scope){ $scope.data = []; };
ngApp.controller('Ctrl', Ctrl);
</script>
<div ng-app="app">
Angular:
<div ng-controller="Ctrl" id="angList"><ul><li ng-repeat="item in data">{{item}}</ul></div>
</div>
<!-- Ember -->
<div id="emapp"></div>
<script type="text/x-handlebars">
Ember:
<ul>
{{#each EMapp.data}}<li>{{this}}</li>{{/each}}
</ul>
</script>
<!-- React -->
<div id="react">
React: <span id="reactMountNode"></span>
</div>
<script>
var ENV = {EXTEND_PROTOTYPES: false};
var ReactComponent = React.createClass({displayName: 'PerfTest',
getInitialState: function() {
return { data: [] };
},
render: function() {
return (
React.createElement("span", null,
this.state.data.map(function(result) {
return React.createElement("span", null, result);
})
)
);
}
});
window.onload = function () {
angular.element(document).ready(function () {
var ang_scope = angular.element(document.getElementById('angList')).scope();
window.ANGclear = function () {
ang_scope.$apply(function (scope) {
scope.data.splice(0, scope.data.length);
})
};
window.ANGpush = function (data){
ang_scope.$apply(function (scope) {
scope.data.push(data + scope.data.length);
})
};
});
EMapp = Ember.Application.create({
rootElement: '#emapp'
});
EMapp.data = Ember.A();
window.EMclear = function () {
EMapp.data.clear();
};
window.EMpush = function (data) {
EMapp.data.pushObject(data);
};
var reactComp = React.render( React.createElement(ReactComponent, null), document.getElementById('reactMountNode'));
window.RClear = function() {
reactComp.setState({data: []})
};
window.RPush = function(data) {
var stateData = reactComp.state.data;
reactComp.setState({data: stateData});
}
}
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
Angular |
| ready |
Ember |
| ready |
React |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.