Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
WeakMap vs property access vs array[0] vs symbol access
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/129.0.0.0 Safari/537.36
Browser:
Chrome 129
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
WeakMap.get
13273565.0 Ops/sec
object.a
26668298.0 Ops/sec
object[symbol]
14262782.0 Ops/sec
array[0]
26421352.0 Ops/sec
Script Preparation code:
var weakMap = new WeakMap() var symbol = Symbol('next'); var object = { a: 1, [symbol]: 1 }; weakMap.set(object, 1); var array = [1];
Tests:
WeakMap.get
weakMap.get(weakMap)
object.a
object.a
object[symbol]
object[symbol]
array[0]
array[0]