Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Direct access vs prototype lookup
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 YaBrowser/24.7.0.0 Safari/537.36
Browser:
Yandex Browser 24
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Direct
118258.9 Ops/sec
Semi-proto
122487.3 Ops/sec
Proto
122830.6 Ops/sec
Script Preparation code:
var LD = Array(100).fill(1).map(() => ({ x: 1, y: 2 })) var P1 = { x: 1 } var LP1 = Array(100).fill(1).map(() => { var A = Object.create(P1); A.y = 2; return A }) var P2 = { x: 1, y: 2 } var LP2 = Array(100).fill(1).map(() => Object.create(P2))
Tests:
Direct
var S = 0 for (let x = 0; x < 100; x++) { let next = LD[x] S = (S + next.x + next.y) } console.log(S)
Semi-proto
var S = 0 for (let x = 0; x < 100; x++) { let next = LP1[x] S = (S + next.x + next.y) } console.log(S)
Proto
var S = 0 for (let x = 0; x < 100; x++) { let next = LP2[x] S = (S + next.x + next.y) } console.log(S)