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
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js">
</script>
<script src="https://cdn.rawgit.com/lodash/lodash/2.4.1/dist/lodash.js">
</script>
<script>
var miArray = new Array(10000);
var doSomething = function(someVal){};
var deps = {};
window.exports = function(){
};
window.module = window.exports;
var lHlp = {
isDefined: function(value) {
return angular.isDefined(value) && value !== null;
},
isFunction: angular.isFunction
};
var _hasErrors = function(collection, cb, ignoreCollection, cbName){
if(!ignoreCollection) {
if (!lHlp.isDefined(collection) || !lHlp.isDefined(cb)) {
$log.error(errorHeader + 'collection or cb undefined');
return true;
}
}
if(!lHlp.isFunction(cb)){
cbName = lHlp.defaultTo(cb,'cb');
$log.error(errorHeader + cbName + ' is not a function');
return true;
}
return false;
};
var _iterate = function(collection, externalCb, internalCb){
if(_hasErrors(undefined, internalCb, true, 'internalCb')){
return;
}
if(!_hasErrors(collection, externalCb)){
for(var key in collection){
internalCb(collection[key], key);
}
}
};
var _each = function(collection, cb){
_iterate(collection, cb, function(val, key){
cb(val, key);
});
};
</script>
<script src="http://cdn.rawgit.com/lodash/lodash/3.10.1/lodash.js">
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.23/browser-polyfill.js"></script>
<script src="https://rawgit.com/jonrimmer/wu-babel/master/es5/wu.js"></script>
Ready to run.
Test | Ops/sec | |
---|---|---|
wu.js |
| ready |
nativo |
| ready |
ES5 Array.forEach |
| ready |
for in |
| ready |
angular |
| ready |
lodash 2.4.1 |
| ready |
angular-leaflet-directive _each |
| ready |
lodash 3.10.1 |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.