Skip to content

chore: Bundle size lab (not for merging) - #3248

Draft
iwoplaza wants to merge 1 commit into
feat/strip-js-implfrom
chore/bundle-size-lab
Draft

iwoplaza wants to merge 1 commit into
feat/strip-js-implfrom
chore/bundle-size-lab

Conversation

@iwoplaza

@iwoplaza iwoplaza commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Not for merging. These are the apps and scripts behind the numbers in #3244–#3247, kept here for inspection. Details are in apps/bundle-size-lab/README.md.

  • Apps: standalone Vite 8 apps made from the four docs examples with the most 'use gpu' functions (monocular-light-injection, selfie-segmentation, os-awards, jelly-slider), each built into one minified chunk. Env vars toggle unstable_stripJsImpl, unstable_obfuscate, unstable_minify and auto-naming.
  • measure.ts: raw/gzip/brotli size of every build, bytes per part of the metadata, and bytes per source (from sourcemaps). results-{main,pr2,pr3,pr4}.json come from running it with the repo at main and at each PR of the stack.
  • formats.ts: re-encodes the metadata in the built bundles in candidate formats and measures the resulting bundles, plus ablations (no AST, no externals, no metadata).
  • bench.ts + decoders.ts: cold-start benchmark of the formats. One fresh Node process per run compiles and runs each app's metadata, then reads all of it. Every format is first checked to decode to the same AST.
  • evaluate.ts: time to import whole bundles in fresh Node processes, with two builds interleaved.
  • serve.ts: serves the builds and records every shader module's code. That's how the generated WGSL was compared between builds in Chromium.
  • examples/tests/revive-check: checks unstable_stripJsImpl by calling functions on the CPU.

Standalone Vite apps made from four docs examples, and the scripts that measured
the v3 metadata format and unstable_stripJsImpl.
@github-actions

Copy link
Copy Markdown

Resolution Time Benchmark

---
config:
  themeVariables:
    xyChart:
      plotColorPalette: "#E63946, #3B82F6, #059669"
---
xychart
  title "Random Branching (🔴 PR | 🔵 main | 🟢 release)"
  x-axis "max depth" [1, 2, 3, 4, 5, 6, 7, 8]
  y-axis "time (ms)"
  line [0.78, 1.60, 3.32, 4.86, 6.91, 9.23, 19.44, 18.26]
  line [0.68, 1.46, 3.28, 4.89, 6.10, 10.15, 19.29, 20.94]
  line [0.70, 1.44, 3.11, 5.25, 5.38, 9.25, 18.33, 17.97]
Loading
---
config:
  themeVariables:
    xyChart:
      plotColorPalette: "#E63946, #3B82F6, #059669"
---
xychart
  title "Linear Recursion (🔴 PR | 🔵 main | 🟢 release)"
  x-axis "max depth" [1, 2, 3, 4, 5, 6, 7, 8]
  y-axis "time (ms)"
  line [0.27, 0.45, 0.59, 0.71, 0.89, 0.98, 1.16, 1.28]
  line [0.28, 0.43, 0.61, 0.61, 0.85, 0.90, 1.05, 1.17]
  line [0.22, 0.41, 0.48, 0.62, 0.83, 0.86, 1.02, 1.12]
Loading
---
config:
  themeVariables:
    xyChart:
      plotColorPalette: "#E63946, #3B82F6, #059669"
---
xychart
  title "Full Tree (🔴 PR | 🔵 main | 🟢 release)"
  x-axis "max depth" [1, 2, 3, 4, 5, 6, 7, 8]
  y-axis "time (ms)"
  line [0.70, 1.70, 3.20, 6.96, 11.01, 21.35, 44.74, 90.55]
  line [0.81, 1.63, 3.08, 5.34, 9.59, 20.99, 45.50, 89.45]
  line [0.68, 1.60, 3.45, 5.77, 10.75, 20.34, 42.05, 87.17]
Loading

@github-actions

Copy link
Copy Markdown

pkg.pr.new

packages
Ready to be installed by your favorite package manager ⬇️

https://pkg.pr.new/software-mansion/TypeGPU/tinyest@854f43cf12df5cd67636c00d14a0ea32be60018c
https://pkg.pr.new/software-mansion/TypeGPU/typegpu@854f43cf12df5cd67636c00d14a0ea32be60018c
https://pkg.pr.new/software-mansion/TypeGPU/unplugin-typegpu@854f43cf12df5cd67636c00d14a0ea32be60018c

benchmark
view benchmark

commit
view commit

@github-actions

Copy link
Copy Markdown

Bundle size comparison (import * as ... in PR vs import * as ... in target):

🟢 Decreased ➖ Unchanged 🔴 Increased ❔ Unknown
0 352 0 0

No notable changes.

If you wish to run a comparison for other, slower bundlers, run the 'Tree-shake test' from the GitHub Actions menu.

This branch has not been deployed

No deployments
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