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

list-view: avoid more work when keys don't change #58

Merged
merged 2 commits into from
Jan 8, 2025

Conversation

benknoble
Copy link
Contributor

According to existing discussion:

  • The removal loop does not trigger the inner conditional when the keys haven't changed anyway, because (member old-k new-keys) should always be true.
  • The call to change-children is redundant when the keys haven't changed because the list of children should also be the same.

Thus we perform some work (looping, conditionals, and importantly a call to change-children) that is unnecessary: for performance, skip it.

Close #57

Best-viewed-with: --ignore-space-change

benknoble and others added 2 commits January 6, 2025 12:18
According to existing discussion:
- The removal loop does not trigger the inner conditional when the keys
  haven't changed anyway, because (member old-k new-keys) should always
  be true.
- The call to change-children is redundant when the keys haven't changed
  because the list of children should also be the same.

Thus we perform some work (looping, conditionals, and importantly a call
to change-children) that is unnecessary: for performance, skip it.

Close Bogdanp#57

Best-viewed-with: --ignore-space-change
@Bogdanp Bogdanp merged commit fd37922 into Bogdanp:master Jan 8, 2025
1 check passed
@Bogdanp
Copy link
Owner

Bogdanp commented Jan 8, 2025

Thanks!

@benknoble
Copy link
Contributor Author

Nice improvement, thanks.

@benknoble benknoble deleted the list-view-avoid-some-work branch January 8, 2025 13:09
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

Successfully merging this pull request may close these issues.

Is list-view doing (slightly) too much work when the keys don't change?
2 participants