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
class ActionType {
inputs = [];
constructor(name){
this.name = name;
}
addInput(input){
this.inputs.push(input);
}
}
function creator(type) {
function Action(value) {
return {
creator: Action,
value,
};
}
Action.type = new ActionType(type);
return Action;
}
class Predefined {
constructor(type, inputs, value, actionCreator){
this.type = type;
this.inputs = inputs;
this.value = value;
this.actionCreator = actionCreator;
}
addInput(input){
this.inputs.push(input);
}
}
function predefined(type){
const inputs = [];
function ActionCreator(value){
return new Predefined(type, inputs, value,ActionCreator);
}
ActionCreator.inputs = inputs;
return ActionCreator;
}
function predefined2(type){
const inputs = [];
return function ActionCreator(value){
return new Predefined(type, inputs, value, ActionCreator);
}
}
let result;
const iter = 1;Ready to run.
| Test | Ops/sec | |
|---|---|---|
| fn | | ready |
| predefined | | ready |
| predefined (action) | | ready |
| predefined2 | | ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.