Create object from array by types and then sort it by order (version: 0)
Speed test comparison of the following:
1. Get an array of objects:
[{id:1,type:"todo", order:"160"}, {id:2,type:"todo", order:"152"}]
2. Convert it into an object with type-keys
{
todo: [{id:1,type:"todo", order:"160"}, {id:2,type:"todo", order:"152"}]
}
3. Sort key-arrays by order:
{
todo: [{id:2,type:"todo", order:"152"}, {id:1,type:"todo", order:"160"}]
}
Memory measurements supported only in Chrome.
For precise memory measurements Chrome must be launched with --enable-precise-memory-info flag.
More information: Monitoring JavaScript Memory
Test case name
Result
Opt1 (fill, place, trim)
Opt2 (reduce, sort keys)
Fastest:N/A
Slowest:N/A
ⓘGet performance results from real users on your website with Request Metrics.
Latest run results:
Run details: (Test run date:
one year ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36