Skip to content
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

Perf optimization: check length/size of lists/sets/dicts/arrays in _Utils_eq #1105

Open
Janiczek opened this issue Apr 7, 2021 · 2 comments

Comments

@Janiczek
Copy link
Contributor

Janiczek commented Apr 7, 2021

Right now there is deep recursive comparison happening even if collection1.length /= collection2.length. It seems to me that we could skip a lot of unneeded work by returning early in those cases.

@github-actions
Copy link

github-actions bot commented Apr 7, 2021

Thanks for reporting this! To set expectations:

  • Issues are reviewed in batches, so it can take some time to get a response.
  • Ask questions a community forum. You will get an answer quicker that way!
  • If you experience something similar, open a new issue. We like duplicates.

Finally, please be patient with the core team. They are trying their best with limited resources.

@JoshuaHall
Copy link

Disclaimer: I'm not that knowledgeable of the kernel code.

Would this be worth it for any type but arrays? The other types are implemented in a recursive/linked list sort of way, so you'd have to traverse the collection to get the length, while the array type seems to be a thin wrapper around regular JavaScript arrays, where getting the length is a constant time operation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants