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

Refactor unary logic #1995

Merged
merged 6 commits into from
Mar 14, 2024
Merged

Refactor unary logic #1995

merged 6 commits into from
Mar 14, 2024

Conversation

benjie
Copy link
Member

@benjie benjie commented Mar 14, 2024

Description

When I built #1973 for unary steps, I went through and methodically updated everywhere that wrote to store and had it write to unaryStore (new) instead for unary steps. There was a lot of "if unary this else that" logic.

When thinking about Early Exit (#2013) I realised that it would be useful to store information along with the step results; this would allow tracking of which steps have errored, etc. and would remove the need to do so via the buckets themselves. Being more granular is generally better.

I realised that by pushing the unary work earlier in the process, not only would I make this easier to accomplish, but I'd also be reducing object allocations as I would be creating each execution value when the step that made it completes (once) rather than each time it is then used in a future step (which could be any number of times).

So this is that refactoring. Theoretically it doesn't change any externally visible behavior, and is just a precursor to the early exit code.

Performance impact

Minor improvement?

Security impact

Unknown.

Checklist

  • My code matches the project's code style and yarn lint:fix passes.
  • I've added tests for the new feature, and yarn test passes.
  • I have detailed the new feature in the relevant documentation.
  • I have added this feature to 'Pending' in the RELEASE_NOTES.md file (if one exists).
  • If this is a breaking change I've explained why.

Copy link

changeset-bot bot commented Mar 14, 2024

🦋 Changeset detected

Latest commit: ba03108

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 15 packages
Name Type
postgraphile Patch
@dataplan/pg Patch
grafast Patch
graphile-utils Patch
pgl Patch
graphile Patch
graphile-build-pg Patch
@localrepo/grafast-bench Patch
@dataplan/json Patch
@grafserv/persisted Patch
grafserv Patch
ruru-components Patch
@localrepo/grafast-website Patch
graphile-build Patch
graphile-export Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@benjie benjie merged commit 9c5542b into main Mar 14, 2024
24 checks passed
@benjie benjie deleted the refactor-unary branch March 14, 2024 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

1 participant