-
-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getIterate.js performance issues #33
Comments
Hi! |
Thanks for the quick response! |
If childrenPath is specified - deepdash doesn't visit other paths. |
Maybe it's a good idea to extend options to let user collapse only holes caused by filtration, and keep other empty slots untouched. It's a pretty complicated way - I will need to remember paths rejected by a filtration process, In case some array has multiple holes left by several rejected paths - it will be a pain to recalculate As a dirty alternative - I can remember not a paths rejected by a filter, but only arrays affected by such rejection. And after filtering process is done - just condense all these arrays.
About spread / concat - there is a separate deepdash-es module - it's not transpiled. |
Actually, after I've seen the performance results of using spread instead of concat, maybe adding the other 2 options that we have discussed are overhead, because the improvement is quite big by itself. Thanks for the quick response and discussion! |
Ok, I will review it tonight. |
Merged and published as v4.2.14 |
I've encountered performance issues in my code (which uses filterDeep) and after some research using Chrome DevTools performance tab, it seems that the getIterate.js file causes performance issues.
Here are 2 images displaying the results of the performance test recordings:
I understand that there must be a deep scan to search for a path which might be relevant for the user (was specified in childrenPath).
but maybe one of these suggestions can help:
it is possible to use spread instead of concat for better performance.
like this:
currentParents = [...parents, currentObj];
instead of
currentParents = parents.concat(currentObj);
or
childPath = [...path, childKey];
instead of
childPath = (path || []).concat([childKey]);
The text was updated successfully, but these errors were encountered: