Skip to content

polish: use closure instead of CollectFieldsContext #4361

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yaacovCR
Copy link
Contributor

@yaacovCR yaacovCR commented Mar 23, 2025

While working on #4360, I felt myself trying to reach for opportunity to remove the CollectFieldsContext type/object that I previously introduced; this is accomplished in this separate PR.

Benchmarking on my machine, this seems essentially no better and no worse in the performance realm. I am evaluating this in terms of readability, both in the local sense and in the overall algorithmic sense of better understanding the method and limit of how we are recursing.

Overall, I think it's a minor improvement.

@yaacovCR yaacovCR requested a review from a team as a code owner March 23, 2025 11:14
Copy link

Hi @yaacovCR, I'm @github-actions bot happy to help you with this PR 👋

Supported commands

Please post this commands in separate comments and only one per comment:

  • @github-actions run-benchmark - Run benchmark comparing base and merge commits for this PR
  • @github-actions publish-pr-on-npm - Build package from this PR and publish it on NPM

@yaacovCR
Copy link
Contributor Author

yaacovCR commented Mar 23, 2025

Note: this would probably be most helpfully reviewed by ignoring whitespace differences and possibly side-by-side comparison.

@yaacovCR yaacovCR force-pushed the use-closure branch 4 times, most recently from 3d891ab to c39f840 Compare March 23, 2025 11:46
@yaacovCR yaacovCR changed the title use closure instead of CollectFieldsContext polish: use closure instead of CollectFieldsContext Mar 23, 2025
@yaacovCR yaacovCR added the PR: polish 💅 PR doesn't change public API or any observed behaviour label Mar 23, 2025
@yaacovCR
Copy link
Contributor Author

Also subtracts about 50 lines of code, which is always good.

From my machine:

image

@yaacovCR
Copy link
Contributor Author

Also subtracts about 50 lines of code, which is always good.

Mostly whitespace/formatting though, so your mileage may vary, but it helps make the code more readable for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: polish 💅 PR doesn't change public API or any observed behaviour
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant