Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
lodash sortBy concat
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/121.0.0.0 Safari/537.36
Browser:
Chrome 121
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
2 years ago
Test name
Executions per second
lodash orderby
329450.1 Ops/sec
native sort
282959.0 Ops/sec
HTML Preparation code:
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.11/lodash.min.js'></script>
Script Preparation code:
var orders = [ { "orderDate": "2023-11-22T04:55:58.792492Z", }, { "orderDate": "2023-11-22T05:55:58.792492Z", }, { "orderDate": "2023-11-22T01:55:58.792492Z", }, { "orderDate": "2023-12-22T01:55:58.792492Z", }, { "orderDate": "2023-11-22T04:55:58.792492Z", }, { "orderDate": "2023-11-22T05:55:58.792492Z", }, { "orderDate": "2023-11-22T01:55:58.792492Z", }, { "orderDate": "2023-12-22T01:55:58.792492Z", }, { "orderDate": "2023-11-22T04:55:58.792492Z", }, { "orderDate": "2023-11-22T05:55:58.792492Z", }, { "orderDate": "2023-11-22T01:55:58.792492Z", }, { "orderDate": "2023-12-22T01:55:58.792492Z", }, { "orderDate": "2023-11-22T04:55:58.792492Z", }, { "orderDate": "2023-11-22T05:55:58.792492Z", }, { "orderDate": "2023-11-22T01:55:58.792492Z", }, { "orderDate": "2023-12-22T01:55:58.792492Z", }, { "orderDate": "2023-11-22T04:55:58.792492Z", }, { "orderDate": "2023-11-22T05:55:58.792492Z", }, { "orderDate": "2023-11-22T01:55:58.792492Z", }, { "orderDate": "2023-12-22T01:55:58.792492Z", } ] var markers = [ { "orderDate": "2023-11-22T04:55:58.792492Z", }, { "orderDate": "2023-11-22T05:55:58.792492Z", }, { "orderDate": "2023-11-22T01:55:58.792492Z", }, { "orderDate": "2023-12-22T01:55:58.792492Z", }, { "orderDate": "2023-11-22T04:55:58.792492Z", }, { "orderDate": "2023-11-22T05:55:58.792492Z", }, { "orderDate": "2023-11-22T01:55:58.792492Z", }, { "orderDate": "2023-12-22T01:55:58.792492Z", }, { "orderDate": "2023-11-22T04:55:58.792492Z", }, { "orderDate": "2023-11-22T05:55:58.792492Z", }, { "orderDate": "2023-11-22T01:55:58.792492Z", }, { "orderDate": "2023-12-22T01:55:58.792492Z", }, { "orderDate": "2023-11-22T04:55:58.792492Z", }, { "orderDate": "2023-11-22T05:55:58.792492Z", }, { "orderDate": "2023-11-22T01:55:58.792492Z", }, { "orderDate": "2023-12-22T01:55:58.792492Z", }, { "orderDate": "2023-11-22T04:55:58.792492Z", }, { "orderDate": "2023-11-22T05:55:58.792492Z", }, { "orderDate": "2023-11-22T01:55:58.792492Z", }, { "orderDate": "2023-12-22T01:55:58.792492Z", } ] var stops = [ { "orderDate": "2023-11-22T04:55:58.792492Z", }, { "orderDate": "2023-11-22T05:55:58.792492Z", }, { "orderDate": "2023-11-22T01:55:58.792492Z", }, { "orderDate": "2023-12-22T01:55:58.792492Z", }, { "orderDate": "2023-11-22T04:55:58.792492Z", }, { "orderDate": "2023-11-22T05:55:58.792492Z", }, { "orderDate": "2023-11-22T01:55:58.792492Z", }, { "orderDate": "2023-12-22T01:55:58.792492Z", }, { "orderDate": "2023-11-22T04:55:58.792492Z", }, { "orderDate": "2023-11-22T05:55:58.792492Z", }, { "orderDate": "2023-11-22T01:55:58.792492Z", }, { "orderDate": "2023-12-22T01:55:58.792492Z", }, { "orderDate": "2023-11-22T04:55:58.792492Z", }, { "orderDate": "2023-11-22T05:55:58.792492Z", }, { "orderDate": "2023-11-22T01:55:58.792492Z", }, { "orderDate": "2023-12-22T01:55:58.792492Z", }, { "orderDate": "2023-11-22T04:55:58.792492Z", }, { "orderDate": "2023-11-22T05:55:58.792492Z", }, { "orderDate": "2023-11-22T01:55:58.792492Z", }, { "orderDate": "2023-12-22T01:55:58.792492Z", } ]
Tests:
lodash orderby
var array = ['all', 'market', 'stop']; var activeTab = array[Math.floor(Math.random() * array.length)]; var res = _.orderBy( [ ...(['all', 'orders'].includes(activeTab) ? orders : []), ...(['all', 'marker'].includes(activeTab) ? markers : []), ...(['all', 'stop'].includes(activeTab) ? stops : []), ], 'orderDate', 'desc' ); res.length;
native sort
var array = ['all', 'market', 'stop']; var activeTab = array[Math.floor(Math.random() * array.length)]; var filteredOrders = []; if (activeTab === 'all') { filteredOrders = filteredOrders.concat(orders).concat(markers).concat(stops); } else if (activeTab === 'market') { filteredOrders = filteredOrders.concat(markers); } else if (activeTab === 'stop') { filteredOrders = filteredOrders.concat(stops); } var res = _.orderBy(filteredOrders, 'orderDate', 'desc' ); res.length;