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 Logger {
static set productionMode(isProduction) {
if (isProduction) {
Logger.log = () => {};
Logger.error = () => {};
Logger.info = () => {};
Logger.warn = () => {};
} else {
Logger.log = console.log;
Logger.error = console.error;
Logger.info = console.info;
Logger.warn = console.warn;
}
}
static log(){}
static error(){}
static info(){}
static warn(){}
}
Logger.productionMode = true;
class Logger2 {
static set productionMode(isProduction) {
if (isProduction) {
Logger2.log = () => {};
Logger2.error = () => {};
Logger2.info = () => {};
Logger2.warn = () => {};
} else {
Logger2.log = console.log;
Logger2.error = console.error;
Logger2.info = console.info;
Logger2.warn = console.warn;
}
}
static log(){}
static error(){}
static info(){}
static warn(){}
}
Logger2.productionMode = false;
Ready to run.
Test | Ops/sec | |
---|---|---|
Logger production mode (empty function) |
| ready |
Logger debug mode (console.log) |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.