Skip to content

feat: LeafList optimization for nullable lists of scalars - #1451

Open
IvanIvanoff wants to merge 3 commits into
absinthe-graphql:mainfrom
IvanIvanoff:feat-leaf-list
Open

feat: LeafList optimization for nullable lists of scalars#1451
IvanIvanoff wants to merge 3 commits into
absinthe-graphql:mainfrom
IvanIvanoff:feat-leaf-list

Conversation

@IvanIvanoff

@IvanIvanoff IvanIvanoff commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

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

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
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.

1 participant