Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Benchmark for comparing common vs unique collator object on each sort iteration
(version: 1)
Comparing performance of:
Using a common object vs Using a separate object
Created:
one year ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
var map = new Map([...Array(1000).keys()].map(a => ([a.toString(), 5]))) var options = { sensitivity: 'base' }; var collator = new Intl.Collator(undefined, options);
Tests:
Using a common object
[...map.keys()].sort(collator.compare).map(k => ([k, map.get(k)]))
Using a separate object
[...map.keys()].sort((a, b) => {var collator = new Intl.Collator(undefined, options); return collator.compare(a, b)}).map(k => ([k, map.get(k)]))
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Using a common object
Using a separate object
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Browser/OS:
Chrome 131 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Using a common object
8672.2 Ops/sec
Using a separate object
141.2 Ops/sec
Related benchmarks:
Map vs Object (get) [2]
spread vs array.from on Map sorted
Map vs Object with check
Map vs Object - Multiple keys
Map vs Object - Dynamic keys
Map vs Object (counter incl)
Map get VS Map has get2
Map get VS Map has get3
JS Array[] vs Map.get()
Comments
Confirm delete:
Do you really want to delete benchmark?