graphql-js
polish: use closure instead of CollectFieldsContext
#4361
Open

polish: use closure instead of CollectFieldsContext #4361

yaacovCR wants to merge 1 commit into graphql:next from yaacovCR:use-closure
yaacovCR
yaacovCR111 days ago (edited 111 days ago)

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 111 days ago
github-actions
github-actions111 days ago

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
yaacovCR111 days ago (edited 111 days ago)

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

yaacovCR yaacovCR force pushed from 9170f552 to 3d891ab5 111 days ago
yaacovCR yaacovCR force pushed from 3d891ab5 to 78a34125 111 days ago
yaacovCR yaacovCR force pushed from 78a34125 to 3d891ab5 111 days ago
yaacovCR yaacovCR force pushed from 3d891ab5 to c39f840b 111 days ago
yaacovCR yaacovCR changed the title use closure instead of CollectFieldsContext polish: use closure instead of CollectFieldsContext 111 days ago
yaacovCR yaacovCR added PR: polish 💅
yaacovCR
yaacovCR111 days ago

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

From my machine:

image

yaacovCR
yaacovCR111 days ago

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.

yaacovCR yaacovCR force pushed from cda07e4e to 534e7f5d 111 days ago
yaacovCR yaacovCR force pushed from dce58a48 to d9e35480 110 days ago
yaacovCR use closure instead of CollectFieldsContext
836d4a50
yaacovCR yaacovCR force pushed from d9e35480 to 836d4a50 44 days ago

Login to write a write a comment.

Login via GitHub

Reviewers
No reviews
Assignees
No one assigned
Labels
Milestone