Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
JS Native Reduce Vs Loadash Reduce
(version: 0)
Comparing performance of:
Native Reduce vs Lodash Reduce
Created:
6 years ago
by:
Registered User
Jump to the latest result
HTML Preparation code:
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js'></script>
Script Preparation code:
var testData = {"100":"100","101":"101","102":"102","103":"103","115":"115","121":"121","123":"123","133":"133","146":"146","149":"149","152":"152","153":"153","154":"154","157":"157","163":"163","164":"164","165":"165","166":"166","167":"167","168":"168","175":"175","176":"176","177":"177","178":"178","179":"179","180":"180","181":"181","182":"182","183":"183","186":"186","187":"187","188":"188","189":"189","190":"190","191":"191","192":"192","193":"193","194":"194","195":"195","196":"196","197":"197","198":"198","199":"199","200":"200","201":"201","202":"202","203":"203","204":"204","205":"205","206":"206","207":"207","208":"208","215":"215","216":"216","217":"217","218":"218","219":"219","220":"220","221":"221","222":"222","223":"223","224":"224","225":"225","226":"226","227":"227","228":"228","229":"229","231":"231","232":"232","233":"233","234":"234","235":"235","236":"236","239":"239","240":"240","241":"241","242":"242","243":"243","244":"244","245":"245","246":"246","247":"247","248":"248","249":"249","250":"250","251":"251","252":"252","253":"253","254":"254","255":"255","256":"256","257":"257","258":"258","259":"259","260":"260","261":"261","262":"262","263":"263","264":"264","265":"265","266":"266","267":"267","268":"268","269":"269","270":"270","271":"271","272":"272","273":"273","274":"274","280":"280","281":"281","282":"282","283":"283","284":"284","285":"285","286":"286","287":"287","288":"288","289":"289","290":"290","291":"291","292":"292","293":"293","296":"296","299":"299","300":"300","301":"301","302":"302","303":"303","304":"304","305":"305","306":"306","307":"307","308":"308","309":"309","310":"310","311":"311","312":"312","313":"313","314":"314","315":"315","316":"316","326":"326","327":"327","328":"328","329":"329","330":"330","331":"331","335":"335","336":"336","337":"337","339":"339","340":"340","344":"344","345":"345","347":"347","350":"350","351":"351","353":"353","354":"354","355":"355","356":"356","357":"357","358":"358","368":"368","369":"369","371":"371","372":"372","374":"374","375":"375","377":"377","378":"378","379":"379","380":"380","381":"381","384":"384","385":"385","386":"386","388":"388","389":"389","390":"390","391":"391","392":"392","393":"393","394":"394","395":"395","416":"416","417":"417","418":"418","419":"419","420":"420","421":"421","423":"423","424":"424","432":"432","433":"433","435":"435","436":"436","437":"437","438":"438","439":"439","440":"440","441":"441","442":"442","444":"444","445":"445","446":"446","454":"454","460":"460","463":"463","464":"464","465":"465","467":"467","469":"469","470":"470","474":"474","475":"475","476":"476","477":"477","478":"478","480":"480","481":"481","482":"482","492":"492","493":"493","494":"494","498":"498","500":"500","501":"501","502":"502","503":"503","504":"504","505":"505","510":"510","511":"511","513":"513","515":"515","516":"516","517":"517","533":"533","534":"534","535":"535","536":"536","539":"539","540":"540","541":"541","542":"542","543":"543","545":"545","546":"546","549":"549","551":"551","552":"552","553":"553","554":"554","555":"555","556":"556","557":"557","558":"558","559":"559","560":"560","561":"561","562":"562","563":"563","564":"564","565":"565","570":"570","571":"571","572":"572","573":"573","574":"574","577":"577","579":"579","580":"580","581":"581","592":"592","593":"593","595":"595","597":"597","598":"598","602":"602","603":"603","604":"604","605":"605","606":"606","607":"607","616":"616","617":"617","622":"622","623":"623","626":"626","628":"628","629":"629","630":"630","637":"637","638":"638","639":"639","640":"640","641":"641","642":"642","643":"643","644":"644","645":"645","653":"653","656":"656","663":"663","665":"665","673":"673","674":"674","675":"675","682":"682","683":"683","684":"684","686":"686","688":"688","689":"689","690":"690","693":"693","695":"695","696":"696","698":"698","699":"699","700":"700","707":"707","715":"715","722":"722","725":"725","726":"726","727":"727","728":"728","749":"749","754":"754","755":"755","757":"757","758":"758","760":"760","776":"776","781":"781","802":"802","803":"803","804":"804","808":"808","809":"809","811":"811","812":"812","813":"813","814":"814","815":"815","816":"816","821":"821","822":"822","823":"823","824":"824","826":"826","827":"827","829":"829","830":"830","834":"834","840":"840","841":"841","842":"842","843":"843","849":"849","853":"853","854":"854","855":"855","856":"856","857":"857","858":"858","862":"862","863":"863","864":"864","865":"865","866":"866","867":"867","869":"869","870":"870","871":"871","872":"872","876":"876","880":"880","882":"882","884":"884","885":"885","894":"894","896":"896","897":"897","901":"901","902":"902","903":"903","904":"904","906":"906","907":"907","908":"908","909":"909","915":"915","917":"917","918":"918","919":"919","920":"920","921":"921","923":"923","928":"928","935":"935","939":"939","940":"940","947":"947","948":"948","949":"949","951":"951","956":"956","957":"957","963":"963","964":"964","969":"969","974":"974","975":"975","976":"976","977":"977","981":"981","982":"982","983":"983","986":"986","987":"987","988":"988","989":"989","001":"001","002":"002","003":"003","004":"004","012":"012","023":"023","024":"024","025":"025","026":"026","027":"027","030":"030","031":"031","034":"034","035":"035","036":"036","037":"037","038":"038","039":"039","040":"040","041":"041","042":"042","052":"052","053":"053","054":"054","055":"055","056":"056","057":"057","059":"059","061":"061","062":"062","064":"064","065":"065","066":"066","067":"067","068":"068","069":"069","070":"070","071":"071","072":"072","073":"073","074":"074","075":"075","077":"077","079":"079","082":"082","083":"083","085":"085","086":"086","087":"087","088":"088","091":"091","092":"092","093":"093","094":"094","095":"095","097":"097"}
Tests:
Native Reduce
Object.keys(testData).sort().reduce( (acc, key) => { if(!acc[key]) acc[key] = testData[key]; return acc; }, {})
Lodash Reduce
_.reduce(Object.keys(testData).sort(), (acc, key) => { if(!acc[key]) acc[key] = testData[key]; return acc }, {})
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Native Reduce
Lodash Reduce
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Autogenerated LLM Summary
(model
llama3.2:3b
, generated one year ago):
I'll provide the answer to the benchmarking challenge without any preamble. **Benchmark Test Results** | **Test Name** | **Benchmark Definition** | | --- | --- | | Native Reduce | `Object.keys(testData).sort().reduce( (acc, key) => {\r\n if(!acc[key]) acc[key] = testData[key];\r\n return acc;\r\n}, {})` | | Lodash Reduce | `_.reduce(Object.keys(testData).sort(), (acc, key) => {\r\n if(!acc[key]) acc[key] = testData[key];\r\n return acc\r\n}, {})` | **Benchmark Results** | **Test Name** | **ExecutionsPerSecond** | | --- | --- | | Native Reduce | 5432.509765625 | | Lodash Reduce | 5498.59130859375 | Let me know if you have any further questions!
Related benchmarks:
mapvalues reduce
Array slice vs for loop 2
slice vs. spread
Slice vs For - 100 item
Comments
Confirm delete:
Do you really want to delete benchmark?