Skip to content

Profile world placement stages and per-section rebuilds - #337

Merged
InventivetalentDev merged 3 commits into
mainfrom
perf/world-placement-profile
Oct 17, 2026
Merged

InventivetalentDev merged 3 commits into
mainfrom
perf/world-placement-profile

Conversation

@InventivetalentDev

@InventivetalentDev InventivetalentDev commented Oct 17, 2026 •

Copy link
Copy Markdown
Owner

The world benchmark counts section builds without identifying which section rebuilt or separating input preparation, worker waits, and mesh assembly. Add opt-in --profile-placement instrumentation to record those stages and attribute each section build to the placement or unload that started it.

The runner instruments four built ESM modules in memory and passes explicit parent IDs through asynchronous rebuilds, including concurrent fluid-only sections. Library source, package output, and the worker stay unchanged. The report includes raw spans, per-stage interval unions, per-section build counts, and a per-pass summary. A build counts as ownColumnBuilds while its section's column is being placed, neighborBuilds during the placement of other columns, and unloadBuilds during unloading. The web build runs the instrumentation against the built library, so a changed instrumented method or a renamed variable that the instrumentation splices in fails yarn build. The README documents the flag, stage boundaries, and timing and memory limits.

On the fixed Minecraft 1.16.2 Etho route, each pass builds 965 sections: 428 during their own column's placement and 537 during later neighbouring placements. No section is built twice within one placement. These are placement-batching candidates (#339), not proof that individual border refreshes are unnecessary.

Validation:

  • Web typecheck and build, including the drift check, pass, as do the library build, yarn test and the other repository suites.
  • Ordinary and profiled hardware Chrome invocations completed with nine loaded columns at all stops, zero missing or failed columns, and no worker fallback. Draw calls, triangles, and geometry and texture counts match at corresponding stops. Every profiled build belongs to a placement, with no instrumentation issues or unfinished spans.
  • Ordinary warm streaming ranged from 1.813 to 2.041 s and profiled runs from 1.918 to 2.011 s, so the overlapping ranges do not isolate the profiler's overhead. Profiled runs retain about 40,500 span records in their heap. Worker-roundtrip timings include queueing and scheduling, not just worker CPU. These measurements describe the nine-column route, whose two raw regions fit in the cache.

@github-actions github-actions Bot added apps Any app under apps/ web Demo and test pages (apps/web) labels Oct 17, 2026
@InventivetalentDev
InventivetalentDev marked this pull request as ready for review October 17, 2026 19:43
@InventivetalentDev
InventivetalentDev merged commit 95f5601 into main Oct 17, 2026
3 checks passed
@InventivetalentDev
InventivetalentDev deleted the perf/world-placement-profile branch October 17, 2026 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

apps Any app under apps/ web Demo and test pages (apps/web)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant