Skip to content

perf: let metadata and section-pages start on their dependency's first chunk - #1240

Open
ovflowd wants to merge 1 commit into
perf/drain-resultsfrom
perf/stream-metadata
Open

ovflowd wants to merge 1 commit into
perf/drain-resultsfrom
perf/stream-metadata

Conversation

@ovflowd

@ovflowd ovflowd commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Description

This PR lets metadata and section-pages start on their dependency's first chunk instead of waiting for all of it, so with more than one thread parsing, metadata and section pages overlap. It's the fourth part of a stack that splits #1205.

  • section-pages passes each module's entries on as they arrive, and adds the chunk pages after the last of them, in module order, as if built from the whole input at once.
  • A module's chunk pages need all of its entries, and a chunk need not hold whole modules, so groupWholeModules regroups streamed entries into batches of whole modules. It rejects a module whose entries come back after another's.

Validation

Added tests for groupWholeModules (a module continuing in the next batch, empty batches, entries given as one array, a module arriving apart), and for section-pages building the same output from several batches, from one batch, from its whole input as with one thread, and a module split across batches. Built on 12 of Node.js's API docs at 1 and 4 threads, the output is byte-identical to main's.

Related Issues

Refs: #1205

Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run node --run test and all tests passed.
  • I have check code formatting with node --run format:check & node --run lint.
  • I've covered new added functionality with unit tests if necessary.

…t chunk

With more than one thread, metadata and section-pages now start on the
first chunk of their dependency instead of waiting for all of it, so
parsing, metadata and section pages overlap. The generated files are
unchanged.

section-pages passes each module's entries on as they arrive and adds
the chunk pages after the last of them, in module order, as if built
from the whole input at once. A module's chunk pages need all of its
entries, and a chunk need not hold whole modules, so groupWholeModules
regroups streamed entries into batches of whole modules, and rejects a
module whose entries come back after another's.

Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
Assisted-by: Claude Sonnet 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
api-docs-tooling Ready Ready Preview Nov 3, 2026 7:35pm UTC

Request Review

@codecov

codecov Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.43%. Comparing base (bad221d) to head (deb7a89).

Additional details and impacted files
@@                  Coverage Diff                   @@
##           perf/drain-results    #1240      +/-   ##
======================================================
+ Coverage               94.37%   94.43%   +0.05%     
======================================================
  Files                     293      293              
  Lines                   30373    30683     +310     
  Branches                 3095     3128      +33     
======================================================
+ Hits                    28666    28976     +310     
  Misses                   1685     1685              
  Partials                   22       22              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅

View logs ↗
No Preview URL. Enable ↗ deb7a89 2026-11-03T19:35:09.517Z View logs ↗

@ovflowd
ovflowd marked this pull request as ready for review November 3, 2026 20:39
@ovflowd
ovflowd requested a review from a team as a code owner November 3, 2026 20:39

This branch was successfully deployed

1 active deployment
Preview – api-docs-tooling — deb7a892 Deployed Nov 3, 2026 by vercel[bot]
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