feat: LeafList optimization for nullable lists of scalars - #1451
Open
IvanIvanoff wants to merge 3 commits into
Open
feat: LeafList optimization for nullable lists of scalars#1451IvanIvanoff wants to merge 3 commits into
IvanIvanoff wants to merge 3 commits into
Conversation
Lists of nullable scalars/enums allocated a Result.Leaf per element and paid per-element work in every pass over the result tree (absinthe-graphql#1245). Resolution now holds their raw values in a single Result.LeafList node: such elements never run middleware and can't be errored or null-trimmed individually, so null propagation skips the node and the Result phase serializes the values in one pass. Non-null element types keep the per-element representation. Also removes two per-element costs on large lists: the non-null error scan skips lists whose element type contains no non-null (and no longer builds Enum.with_index tuples), and walk_results no longer rebuilds the Resolution struct per element just to record the path. Also add benchmark tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extract the LeafList part from #1448. The rest of the PR was folded into #1450.
The new result node (Absinthe.Blueprint.Result.LeafList) introduced here is used by absinthe_phoenix, so using the next version of absinthe will require updating absinthe_phoenix to include this PR: absinthe-graphql/absinthe_phoenix#111