Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Set has vs object key - small object
performance comparison of looking up a value from a set
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/134.0.0.0 Safari/537.36
Browser:
Chrome 134
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Includes
29191880.0 Ops/sec
Object[key]
97597504.0 Ops/sec
Set.has
107596240.0 Ops/sec
Script Preparation code:
var obj = { '.': true, ' ': true, ',': true, ';': true, }; var array = Object.keys(obj); var set = new Set(array);
Tests:
Includes
array.includes(',') && array.includes('/')
Object[key]
obj[','] && obj['/']
Set.has
set.has(',') && set.has('/')