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://cdn.jsdelivr.net/immutable.js/3.7.2/immutable.min.js"></script>
<script src="//cdn.rawgit.com/mcwhittemore/9f0f189b2d4c46c5338a/raw/b6a1f8d1c90ff7942d6bbdaf40dcab2ee0cb6a59/alt.js"></script>
<script src="https://cdn.rawgit.com/mcwhittemore/9f0f189b2d4c46c5338a/raw/7f3396965efb285821071cdfd4a6ebc719899aa7/flummox.js"></script>function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min)) + min;
}
var id = 0;
function newItem(){
id++;
return Immutable.Map({
id: id,
x: getRandomInt(0,1000),
y: getRandomInt(0,1000),
isSelected: getRandomInt(0,1) ? true : false
});
}
var possibleActions = ["push", "pop"];
var stackSize = 0;
var actions = [];
for(var i=0; i<10000; i++){
var action = "push";
if(stackSize>0){
var actionId = getRandomInt(0,1);
action = possibleActions[actionId];
}
if(action=="push"){ stackSize++; }
else { stackSize--; }
actions.push(action);
}
function runner(api){
for(var i=0; i<actions.length; i++){
var action = actions[i];
api[action]();
}
}
window.flummox.store.on('change',function(){
var items = window.flummox.store.state.items;
});
window.altjs.store.listen(function(store){
var items = window.altjs.store.getState().items;
});Ready to run.
| Test | Ops/sec | |
|---|---|---|
| Flummox | | ready |
| Alt.js | | ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.