question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

getIterate.js performance issues

See original GitHub issue

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: image

image

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:

  1. Add a maxScanDepth (number) option, which will limit the depth of the search for cases where the user knows his deep object’s structure and doesn’t want to scan all the paths in the scanned object.
  2. Add a isExactChildrenPath (boolean) for cases where only the paths specified by the user in the childrenPath parameter are relevant and there is no need to search other paths (Ofcourse he must supply the full path).
  3. As mentioned in this stackoverflow question and was tested here 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]);

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
YuriGorcommented, Sep 1, 2019

Ok, I will review it tonight. Thank you for contribution!

0reactions
YuriGorcommented, Sep 1, 2019

Merged and published as v4.2.14 Please test and put a star if everything still works 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Debug Performance Issues in JavaScript - LoadNinja
Learn how to debug performance issues using Google Chrome's DevTools and browser-based load testing tools.
Read more >
JavaScript for loop performance issue - Stack Overflow
The problem i am facing is the low performance. See the example code snippets. Following two methods has the performance issue.
Read more >
Measuring Performance of Different JavaScript Loop Types
Now, let's use these methods to measure the performance of different types of Loops in JavaScript. Let's Compare the Performance of JS Loops....
Read more >
Performance of for loops with JavaScript - Incredible Web
The objective of this experiment is to test the different performances of the Lodash's foreach loop, the ES6 for...of loop, the traditional for ......
Read more >
3 JavaScript Performance Mistakes You Should Stop Doing
What if I told you everything you knew was a lie, what will happen if you learn some of the key features our...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found