Skip to content

Conversation

glasser
Copy link
Contributor

@glasser glasser commented Aug 24, 2022

As far as I can tell, the ordering of subsequentPayloads is not used for
anything, so this lets use convert the O(n) indexOf and splice
operations in yieldSubsequentPayloads to sublinear.

As far as I can tell, the ordering of subsequentPayloads is not used for
anything, so this lets use convert the O(n) indexOf and splice
operations in yieldSubsequentPayloads to sublinear.
@glasser
Copy link
Contributor Author

glasser commented Aug 24, 2022

cc @robrichard @IvanGoncharov

@github-actions
Copy link

Hi @glasser, 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

@robrichard robrichard merged commit 857b440 into graphql:defer-stream Aug 24, 2022
@glasser
Copy link
Contributor Author

glasser commented Aug 24, 2022

Actually, since Set.forEach iterates in insertion order, my caveat about "the ordering of subsequentPayloads is not used for anything" isn't even relevant. Since all we ever did is push unique newly created items, forEach order should be identical between the array and the Set.

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.

2 participants