Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Symbol vs String property square bracket, loop
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36
Browser:
Chrome 119
Operating system:
Linux
Device Platform:
Desktop
Date tested:
2 years ago
Test name
Executions per second
Symbol
2786229.0 Ops/sec
String
2723901.2 Ops/sec
Script Preparation code:
var foo1 = {}; var foo2 = {}; var sym = [Symbol("key1"), Symbol("key2"), Symbol("key3"), Symbol("key4"), Symbol("key5"), Symbol("key6"), Symbol("key7"), Symbol("key8"), Symbol("key9"), Symbol("key0")]; var str = ["key1", "key2", "key3", "key4", "key5", "key6", "key7", "key8", "key9", "key0"];
Tests:
Symbol
for(const k of sym) foo1[k] = 1;
String
for(const k of str) foo2[k] = 1;