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
<!-- Jquery -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.7/angular.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.3.0/handlebars.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ember.js/1.13.4/ember-template-compiler.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ember.js/1.13.4/ember.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.13.3/react.min.js"></script>
<!-- Angular -->
<div ng-app>
Angular:
<span ng-init="data = []" id="angList"><span ng-repeat="item in data track by item">{{::item}}</span></span>
</div>
<!-- Ember -->
<div id="emapp"></div>
<script type="text/x-handlebars">
Ember:
<span>
{{#each EMapp.data}}<span>{{this}}</span>{{/each}}
</span>
</script>
<!-- React -->
<div id="react">
React: <span id="reactMountNode"></span>
</div>
<script>
//var Ctrl = function($scope){
// $scope.data = [];
//};
var ENV = {EXTEND_PROTOTYPES: false};
var ReactComponent = React.createClass({displayName: 'PerfTest',
getInitialState: function() {
return { data: [] };
},
render: function() {
var res = [];
for(var i = 0; i < this.state.data.length; i++) {
res.push(React.DOM.span({ key: 'test' + i }, this.state.data[i]));
}
return React.DOM.span(null, res);
}
});
$(document).ready(function() {
angular.element(document).ready(function() {
var ang_scope = angular.element('#angList').scope();
window.ANGclear = function(){
ang_scope.data = [];
};
window.ANGpush = function(data){
ang_scope.data.push(data);
};
});
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 = ReactComponent();
React.renderComponent(reactComp, $('#reactMountNode')[0]);
window.RClear = function() {
reactComp.setState({data: []})
};
window.RPush = function(data) {
var stateData = reactComp.state.data;
stateData.push(data);
reactComp.setState({data: stateData});
}
});
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
Angular 1000 |
| ready |
Ember 1000 |
| ready |
React 1000 |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.