Skip to content

app: answer leaves-many counts and gzip at level 1 - #556

Merged
akhileshh merged 1 commit into
mainfrom
leaves-many-l2-counts
Nov 24, 2026
Merged

akhileshh merged 1 commit into
mainfrom
leaves-many-l2-counts

Conversation

@akhileshh

@akhileshh akhileshh commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • node/leaves_many takes counts_only=true and answers {"<node_id>": <count>}: each node's number of nodes at stop_layer, in place of their ids. Without the flag the answer is unchanged.
  • after_request gzips every answer at level 1 rather than the default 9.

Why

  • A caller sizing fragments by their L2 count no longer downloads every L2 id to count them.
  • Measured through the real app with the graph walk stubbed, a million-id answer spent 0.403 s of a 0.505 s request in gzip at level 9. At level 1 the request takes 0.249 s, and the answer grows from 8.85 MB to 9.69 MB.
  • Every gzip decoder reads either level, so clients need no change.

🤖 Generated with Claude Code

- handle_leaves_many answers each node's leaf count when counts_only=true.
- after_request gzips at level 1, 4x faster than the default 9 for 9% more bytes.

Co-Authored-By: Claude <noreply@anthropic.com>
@akhileshh
akhileshh merged commit fdf706f into main Nov 24, 2026
1 check passed
@akhileshh
akhileshh deleted the leaves-many-l2-counts branch November 24, 2026 00:09
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