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
https://twitter.com/jaffathecake/status/306706682552143872
jaffathecake: Avoid "+new Date" to generate timestamps during animation. Use "Date.now()" or "performance.now()" instead http://t.co/Hle0qzxWeZ
<script>
window.saveIt = function(x){
var saveIt2 = function(y){Math.pow(y, 1.1)}
var saveIt3 = function(y){Math.pow(y, 1.1)}
if (x % 2) {
saveIt2(x);
}
else {
saveIt3(x);
}
try {throw 1}
catch(e){}
};
</script>
var perf = performance;
var result = 0;
// use the result to prevent the code being thrown out
window.saveIt(result);
Ready to run.
Test | Ops/sec | |
---|---|---|
Date.now |
| ready |
+new Date() |
| ready |
performance.now() |
| ready |
new Date().getTime() |
| ready |
new Date().valueOf() |
| ready |
Cached performance object |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.