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 identity = (raw) => raw
const parsers = {
name(raw) {
return raw.split(" ")
},
address(raw) {
return raw.match(/(\d+)\s+(.*)/).slice(1, 3)
},
}
const proxy = new Proxy(parsers, {
get: (target, prop) => target[prop] || identity,
})
const source = JSON.stringify([
{
"name": "Ulick Olivi",
"address": "5049 Holmberg Lane",
"airport": "Uytash Airport"
}, {
"name": "Veronike Martello",
"address": "5 Clarendon Road",
"airport": "Cherepovets Airport"
}, {
"name": "Darrin Pearse",
"address": "20537 Thompson Lane",
"airport": "Tortolì Airport"
}, {
"name": "Doralynne Enochsson",
"address": "73 Clyde Gallagher Parkway",
"airport": "Mansons Landing Seaplane Base"
}, {
"name": "Scottie Glasner",
"address": "8171 Glendale Alley",
"airport": "A P Hill AAF (Fort A P Hill) Airport"
}, {
"name": "Nicolais Yeomans",
"address": "0223 Manley Terrace",
"airport": "Afore Airstrip"
}, {
"name": "Madeleine Gallant",
"address": "16 Browning Center",
"airport": "Sky Harbor Airport"
}, {
"name": "Morgana Larkkem",
"address": "9 Fordem Point",
"airport": "Aiome Airport"
}, {
"name": "Dillie Rankcom",
"address": "6523 Lerdahl Road",
"airport": "Kissidougou Airport"
}, {
"name": "Sherline Thombleson",
"address": "4397 Utah Park",
"airport": "Kaiapit Airport"
},
])
const parseWithoutProxy = (raw) => JSON.parse(raw, (key, value) => key in parsers
? parsers[key](value)
: value)
const parseWithProxy = (raw) => JSON.parse(raw, (key, value) => proxy[key](value))
Ready to run.
Test | Ops/sec | |
---|---|---|
Parse no Proxy |
| ready |
Parse with Proxy |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.