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
const color=['black',"brown","red","orange","yellow","green","blue","violet","grey","white"]
const colorMap={'black':0,"brown":1,"red":2,"orange":3,"yellow":4,"green":5,"blue":6,"violet":7,"grey":8,"white":9}
const decodedValue1 = (code1) => Number(String(color.indexOf(code1[0]))+String(color.indexOf(code1[1])))
const decodedValue2 = (code1) => color.indexOf(code1[0])*10 +color.indexOf(code1[1])
const decodedValue3 = (code1) => color[code1[0]]*10 +color[code1[1]]
Ready to run.
Test | Ops/sec | |
---|---|---|
string |
| ready |
number |
| ready |
map |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.