Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
11dsad
(version: 0)
11
Comparing performance of:
1 vs 2
Created:
8 years ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.10.1/lodash.min.js"></script> <script> const obj = { FfRBlu6pol: { kioQFf: { polFf6ip11: { l11l11U: { poll11I1111g1lu66R: {} }, l11116l11K: {}, opNpolpol: {}, Nlu6P: {}, polYNl11gd6Ulu6: {} } }, Rg1lu6: { Blu6polgd11: { Blu6polgdl116NF: { NP: { poll11F: { FfRBlu6polgdg1: { opNBlu6polgdg1: { opNBl11Fgdg1: {} }, NBlu6polgdg1: { oplu6PUgdg1: {}, NFfFfkiogdg1: {}, lu6RpolNiopgdg1: {} }, FfN11gdg1: { g1FfopRgdg1: {}, FfN11kioNlu6gdg1: { l11kioRlu6hgdg1: { l11FfPgdg1: {}, l11R11hgdg1: { l11R11ip11Pl116NFIopgdg1: {} } }, ip11Npolgdg1: {}, Fkiog1lu6l11g1ip11Ffgdg1: {}, FfP11g1NkioNiopgdg1: {}, PFfl11g1ip11Ffgdg1: {}, polYNl11gdg1: { l11116l11Kgdg1: { l11116l11KgdFip11ip11gdg1: {}, Nlu6Pgdg1: {}, polYNl11kiogdg1: {}, lu66Pgdg1: { lu66PFgdg1: {}, lu66PPgdg1: {} } } }, lu6RB11l11g1ip11Ffgdg1: {} } }, lu6N11poltall11gdg1: { lu6N11gdg1: { IPg1PPgdg1: { BFip11gdg1: {}, lu6iopg1FfPgdg1: {} }, IPN6gdg1: { IPIFgdg1: { IPg1ip11ip11Rkiopolpoltal4gdg1: {}, IPg1ip11ip11Rkiopolpoltal6gdg1: {} }, IPRlu6tal6gdg1: {}, IPRlu6gdg1: {} } } }, iopNBlu6polgdg1: {} } } } }, kioQFfgd11: { l11g1BINkiolu6gd11: { polFf6ip11gd11: { l11l11Ugd11: { l116FfpoliopIlu6l11hgd11: { l116Ffg1PPpolgd11: { polkiol11URIlu6Ygd11: { l11kioRlu6IFIl11g1lu6kiopolgdl116NFgd11: { l11kioRlu6IFIl11g1lu6kiogd11: {} }, l11R11gdl116NFgd11: { l11R11gdINF6gd11: {} } } } } } } } }, FUNl11gd11: { Blu6polgdpolkioRtalIl11kio: {} } }, RUNlu6IFfkiogdtalIkioiop: { FfRBlu6polgdR: { l116NFgdRkioF: {}, kioQFfgdR: { g1PkioQFfgdR: { g111ip11gdR: {}, g1PkioQFfgdl116NFgdFf: {}, l11g1BINkiolu6gdR: { BBFf6ip11gdR: { l116NFgdRkioF: {}, RkioF: {} }, l116NFgdRkioF: {}, RkioF: {}, polFf6ip11gdR: { l116NFgdRkioF: {}, opNpolpolkiogdR: {}, opNpolpolIgdR: {}, RkioF: {}, polFPgdR: { RkioF: {} } } }, l116NFgdRkioF: {}, PhYg1Nlu6gdR: {}, RFf6ip11gdR: { g1Nlu611gdR: { g1Nlu611gdl116NFgdFf: {}, l116NFgdRkioF: {}, RkioF: {} }, l116NFgdRkioF: {}, kiog1l11gdR: { RkioF: {} }, Fg1NgdR: { RkioF: {} }, RkioF: {}, RFf6ip11gdl116NFgdFf: {}, RFf6ip11gdFf: {}, Rpol11gdR: { l116NFgdRkioF: {}, RkioF: {}, Rpol11gdl116NFgdFf: {} }, polFPgdR: { RkioF: {} } } }, hioplu66PgdR: { l11g1B11INKgdR: { l116NFgdRkioF: {}, RkioF: {} }, op11INKgdR: {} } }, opNBlu6polgdR: { l116NFgdRkioF: {}, opNBl11FgdR: { l116NFgdRkioF: {}, opNl11kio11gdR: { l11g1RRIkioRopR6UPl11gdR: { l116NFgdRkioF: {}, RkioF: {} }, l116NFgdRkioF: {}, RkioF: {} } } }, NBlu6polgdR: { l116NFgdRkioF: {}, Nl11kio11gdR: { l116NFgdRkioF: {}, Nl11kio11gdFip11ip11gdR: { l116NFgdRkioF: {} }, RkioF: {}, polIBgdR: { l116NFgdRkioF: {} } }, NFfFfkiogdR: { l116NFgdRkioF: {} } }, FfN11gdl116NFgdFf: { l11Ffip11gdl116NFgdFf: {}, FfN11kioNlu6gdl116NFgdFf: { BBg1ip11FfgdR: { BBP6611gdR: {}, l116NFgdRkioF: {} }, l11g1Pl11FopgdR: {}, Fkiog1lu6l11g1ip11Ffgdl116NFgdFf: { l116NFgdRkioF: {} }, FfP11g1NkioNiopgdl116NFgdFf: { FfP11g1NkioNiopgdR: {} }, polkiol11g1ip11Ffgdl116NFgdFf: {}, polYNl11gdl116NFgdFf: { l11116l11Kgdl116NFgdFf: { l11116l11KgdR: { l116NFgdRkioF: {} }, Nlu6Pgdl116NFgdFf: { Nlu6PgdR: { l116NFgdRkioF: {} }, RkioF: {} }, RkioF: {}, polYNl11kiogdl116NFgdFf: { polYNl11kiogdR: {} }, lu66Pgdl116NFgdFf: { lu66PFgdl116NFgdFf: { lu66PFgdR: {} }, lu66PPgdl116NFgdFf: { lu66PPgdR: {} } } } }, lu6RB11l11g1ip11Ffgdl116NFgdFf: { lu6RB11l11g1ip11FfgdR: { l116NFgdRkioF: {} } } }, FfN11gdR: { l116NFgdRkioF: {} } }, lu6N11poltall11gdl116NFgdFf: { lu6N11gdl116NFgdFf: { IPN6gdl116NFgdFf: { PINopRkioQgdl116NFgdFf: { PINopRkiopolgdl116NFgdFf: {} } }, lu6N11gdR: {} } }, iopNBlu6polgdR: { l116NFgdRkioF: {}, iopNl11kio11gdR: { l116NFgdRkioF: {}, RkioF: {} } } } }, poliopFf: { poliopgdip116iopN116g1ip11gdRkioQ: { FI11kiogdpollu6g1lu6kiogd11: {}, poliopgdip116iopN116g1ip11gdpollu6g1lu6Upol: {} } }, URI: { polkiopolpolI6N: { g1ip11ip11gdl11kioRlu6IFIl11g1lu6kiogdINip11: {}, g111ip11gdl116NFIopURkiogdINip11: {}, B116l11KgdINip11: {}, l11hg1Nopkiogdip11g1l11gdiop6Rip11gdINip11: {}, l11hg1Nopkiogdkiolu6hkioRNkiolu6gdP6Rlu6gdpolkiol11URIlu6YgdINip11: {}, l11hg1Nopkiogd116l11g111gdg1l11l116UNlu6gdpollu6g1lu6kiogdINip11: {}, l11hg1Nopkiogdlu6kiopollu6gdl11116l11Kgdpollu6g1lu6kiogdINip11: {}, l11FfPgdl116NFIopgdINip11: {}, l11FfPgdINIlu6Ig111IZkiogdINip11: {}, l11FfPgdKkioYgdUPip11g1lu6kiogdINip11: {}, l116NFIopURg1lu6I6NgdRkiopolkiolu6gdINip11: {}, l11R11gdUPip11g1lu6kiogdINip11: {}, ip11kio11gdl11kioRlu6IFIl11g1lu6kiogdINip11: {}, ip11Ipolg1B11kiogdP6iopkioRgd11INkiogdINip11: {}, kioNg1B11kiogdP6iopkioRgd11INkiogdINip11: {}, opkiolu6gdl11kioRlu6IFIl11g1lu6kiogdFI11kiogdINip11: {}, opkiolu6gdFRkioQUkioNl11YgdhIpollu66RYgdINip11: {}, opkiolu6gdIFfgdpolNg1Ppolh6lu6gdINip11: {}, opkiolu6gdRg1iopgdg111g1RFfgdhIpollu66RYgdINip11: {}, opkiolu6gdpoliopgdip116iopN116g1ip11gdRkioP6Rlu6gdINip11: {}, opkiolu6gdpoliopgdhIpollu66RYgdRkioP6Rlu6gdINip11: {}, Ffg1INlu6kioNg1Nl11kiogdip116NkiogdINip11: {}, Ff6ip11IFYgdpolpolhgdUpolkioRgdINip11: {}, P11g1Ngdtalg111Iip11g1lu6kiogdINip11: {}, RkioFf6talkiogdINip11: {}, Rkiopolkiolu6gdlu66gdlu6kiopollu6gdip11kioip11Il11g1lu6kioip11gdINip11: {}, Rkiopollu66RkiogdtalkioNip116Rgdl11kioRlu6IFIl11g1lu6kiogdINip11: {}, RUNgdBg1polhgdl116FfFfg1Nip11gdINip11: {}, polkiolu6gdg1Nop11kiogdINip11: {}, polkiolu6gdRg1ip11gdPg1Rg1FfpolgdINip11: {}, pollu6g1Rlu6gdl116g1Rpolkiogdlu6UNINopgdINip11: {}, poliopgdR61111Bg1l11KgdINip11: {}, poliopgdUPip11g1lu6kiogdg1B6Rlu6gdINip11: {}, poliopgdUPip11g1lu6kiogdINip11: { poliopgdFI11kiogdlu6Rg1NpolFkioRgdN6lu6IF: {}, poliopgdUPip11g1lu6kiogdRkiopolU11lu6: {} }, UNB116l11KgdINip11: {}, UpolkioRgdg1l11l116UNlu6gdpolkiolu6gdINip11: {}, talpoliopRgdlu6hRkiopolh611ip11gdpolkiolu6gdINip11: {}, talpoliopRgdlu6hRkiopolh611ip11gdlu6UNINopgdpollu6g1Rlu6gdINip11: {}, talpoliopRgdlu6hRkiopolh611ip11gdlu6UNINopgdpollu66PgdINip11: {} } }, ioplu6pol: { l116RkiogdP6611gd11: {}, iopBlu6polgd11: { iopNl11kio11opgd11: {}, iopNl11kio11gd11: { l11g1RRIkioRgdopR6UPgd11: { UP11g1Nkiogdl11g1RRIkioRgd11: {} }, l11kio1111gdP611Il11Y: {} } } } } } }; function gen1(struct, currPath = '/', paths = {}) { return Object.keys(struct).reduce((pathsAcc, prop) => { const newPath = `${currPath}${prop}`; pathsAcc[prop] = pathsAcc[prop] || []; pathsAcc[prop].push(newPath); return gen1(struct[prop], `${newPath}/`, pathsAcc); }, paths); }; function gen2(struct, currPath = '/', paths = {}) { return _.reduce(struct, (pathsAcc, prop, propName) => { const newPath = `${currPath}${propName}`; pathsAcc[propName] = pathsAcc[propName] || []; pathsAcc[propName].push(newPath); return gen2(struct[propName], `${newPath}/`, pathsAcc); }, paths); }; </script>
Tests:
1
gen1(obj);
2
gen2(obj);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
1
2
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):
Based on the provided benchmark definition and result, I can see that there are two test cases: `gen1` and `gen2`. The first test case generates a list of paths using the `gen1` function, while the second test case generates another list of paths using the `gen2` function. Comparing the two test cases, I notice that they have similar inputs and outputs. Both functions seem to be generating lists of nested paths. To provide a more detailed answer, I would like to know more about the specific use cases or requirements for these benchmark definitions. However, based on the provided information, here is a possible explanation: The `gen1` function generates a list of paths by recursively traversing an object using a depth-first search approach. The `gen2` function uses Lodash's `_.reduce` method to achieve a similar result. In terms of performance, both functions seem to have similar execution times for the given input object. However, there is a slight difference in the number of executions per second between the two test cases (4172.34 for `gen1` and 2172.04 for `gen2`). This might be due to various factors such as optimization differences or the specific characteristics of the input object. To further improve performance or optimize these functions, additional analysis and testing would be required to identify potential bottlenecks or areas for optimization.
Related benchmarks:
lodash includes vs ramda includes
js-map/obj-3
js-map/obj-4
Lodash vs Ramda fromPairs
lodash vs radash 3
Comments
Confirm delete:
Do you really want to delete benchmark?