Skip to content

Restore GLB packing throughput with bounded batches - #265

Merged
mahach666 merged 1 commit into
mainfrom
codex/glb-batch-packing-performance
Nov 19, 2026
Merged

mahach666 merged 1 commit into
mainfrom
codex/glb-batch-packing-performance

Conversation

@mahach666

@mahach666 mahach666 commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Changes

  • Reserve space for a batch of positions, normals, colors or indices at a time in the existing 64 KiB packing buffer.
  • Normalize triangle normals as the batch is written, using the existing accumulated values and normalization formula.
  • Keep the disk-backed BIN spool and the aligned GLB size checks.

Follow-up to #264 and #46.

Measurements

Windows, .NET 10.0.12 Release. The same synthetic model uses 12 meshes with 60,000 vertices each. Medians of 15 timed exports after four warm-up rounds, rotating the three exporters and writing to Stream.Null.

Version Median
Before #264 19.84 ms
After #264 20.27 ms
This change 18.04 ms

All three exporters produced identical 18,727,900-byte GLBs. SHA-256 was 7ed1b5462175c6e810acf9b7933826d7bcb1f1d0f22542840f0bc10883a29637. The reproduction is documented in docs/test-fixtures.md.

A second run on the committed code measured 18.08 ms, versus 20.98 ms after #264 and 19.77 ms before it. All three GLBs were again byte-identical.

Verification

  • Added byte-for-byte BIN tests across batch boundaries for positions, normals, line colors, and 16-bit and 32-bit indices, including padding.
  • The existing size tests passed for logical lengths above 2 GiB, the 4,294,967,292-byte aligned limit, and rejection before writing when the limit is exceeded.
  • Release build and format verification passed. 2,832 tests passed across .NET 8 and .NET 10. The 24 private-fixture runs were skipped because the files were unavailable.

@mahach666
mahach666 merged commit 2f32338 into main Nov 19, 2026
5 checks passed
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