Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
es6 map access with string vs symbol keys 12
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (iPhone; CPU iPhone OS 19_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1
Browser:
Mobile Safari 26
Operating system:
iOS 19.0
Device Platform:
Mobile
Date tested:
9 months ago
Test name
Executions per second
Get string key from map with only string keys
525480096.0 Ops/sec
Get symbol key from map with mixed string and symbol keys
506702720.0 Ops/sec
Script Preparation code:
var eightSymbol = Symbol("eight") var eightString = "eight"; var mapStringKeys = new Map([["one", true], ["two", true], ["three", true], ["four", true], ["five", true], ["six", true], ["seven", true], ["eight", true], ["nine", true], ["ten", true]]); var mapStringAndSymbolKeys = new Map([["one", true], [Symbol("two"), true], ["three", true], [Symbol("four"), true], ["five", true], [Symbol("six"), true], ["seven", true], [eightSymbol, true], ["nine", true], [Symbol("ten"), true]]);
Tests:
Get string key from map with only string keys
var value = mapStringKeys.get(eightString);
Get symbol key from map with mixed string and symbol keys
var value = mapStringAndSymbolKeys.get(eightSymbol);