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
var e1 = {metaKey:1,shiftKey:1,altKey:1,ctrlKey:1}
var e2 = {metaKey:1,shiftKey:1,altKey:1,ctrlKey:0}
var e3 = {metaKey:0,shiftKey:1,altKey:1,ctrlKey:0}
var e4 = {metaKey:0,shiftKey:0,altKey:1,ctrlKey:0}
g1 = function(e){
return 0 | (e.metaKey ? 1 : 0) | (e.altKey ? 2 : 0)
| (e.shiftKey ? 4 : 0) | (e.ctrlKey ? 8 : 0);
}
g2 = function(e){
return (e.metaKey ? "1" : "") + (e.altKey ? "2" : "")
+ (e.shiftKey ? "4" : "") + (e.ctrlKey ? "8" : "");
}
g3 = function(e){
var a = ""
if(e.metaKey) a+= "1"
if(e.altKey) a+= "2"
if(e.shiftKey) a+= "4"
if(e.ctrlKey) a+= "8"
return a
}
Ready to run.
Test | Ops/sec | |
---|---|---|
1 |
| ready |
2 |
| ready |
3 |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.