Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Vanilla vs Lodash
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/131.0.0.0 Safari/537.36
Browser:
Chrome 131
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Vanilla
2138832.2 Ops/sec
Lodash
1111448.8 Ops/sec
HTML Preparation code:
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js'></script>
Tests:
Vanilla
const offerGameIds = [ { GameId: '4208' }, { GameId: '4017' }, { GameId: '4070' }, { GameId: '4035' }, { GameId: '4110' }, { GameId: '4218' }, { GameId: '4114' }, { GameId: '4193' }, { GameId: '4219' }, { GameId: '4184' }, { GameId: '4216' }, { GameId: '4142' } ]; const cmsGameIds = [4222, 4253, 4215, 4141, 4178, 4182, 4135, 4217, 4200, 4194, 4114, 4193, 4219, 4184, 4216, 4142, 4079, 4070, 4035, 4110]; const commonIds = offerGameIds.map(item => +item.GameId).filter(id => cmsGameIds.includes(id)); const remainingIds = cmsGameIds.filter(id => !commonIds.includes(id)); const finalArray = commonIds.concat(remainingIds);
Lodash
const offerGameIds = [ { GameId: '4208' }, { GameId: '4017' }, { GameId: '4070' }, { GameId: '4035' }, { GameId: '4110' }, { GameId: '4218' }, { GameId: '4114' }, { GameId: '4193' }, { GameId: '4219' }, { GameId: '4184' }, { GameId: '4216' }, { GameId: '4142' } ]; const cmsGameIds = [4222, 4253, 4215, 4141, 4178, 4182, 4135, 4217, 4200, 4194, 4114, 4193, 4219, 4184, 4216, 4142, 4079, 4070, 4035, 4110]; const infoOfferGameIds = offerGameIds.map(item => +item.GameId); const intersection = _.intersection(infoOfferGameIds, cmsGameIds); const finalArray = _.union(intersection, _.without(cmsGameIds, ...intersection));