Repository navigation
Impr(unplugin-typegpu): Support for early pruning in Babel plugin - #3295
cieplypolar wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
|
pkg.pr.new packages benchmark commit |
4ee0d92 to
ffadf58
Compare
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 [1.08, 2.22, 5.28, 7.49, 8.61, 16.59, 30.09, 29.25]
line [1.12, 2.27, 4.79, 7.20, 8.86, 13.20, 29.03, 27.37]
line [1.08, 2.29, 4.32, 7.57, 8.54, 12.10, 28.50, 28.47]
---
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.34, 0.58, 0.81, 0.98, 1.40, 1.41, 1.67, 1.82]
line [0.37, 0.61, 0.80, 0.97, 1.27, 1.37, 1.64, 1.81]
line [0.33, 0.54, 0.78, 0.91, 1.25, 1.29, 1.55, 1.75]
---
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.98, 2.43, 4.35, 8.74, 15.51, 30.26, 63.12, 130.13]
line [0.83, 2.34, 4.51, 8.23, 14.76, 29.34, 64.70, 125.70]
line [0.93, 2.32, 4.08, 7.59, 15.59, 28.24, 60.63, 122.66]
|
Bundle size comparison (
|
| 🟢 Decreased | ➖ Unchanged | 🔴 Increased | ❔ Unknown |
|---|---|---|---|
| 0 | 355 | 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.
babel pluginThere was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — read the full diff (4 files, +95/-16), ran the affected unplugin-typegpu tests, test:types, oxlint and oxfmt, and checked the surrounding common.ts / bun.ts / node.ts / factory.ts early-prune paths.
src/babel.tsearly pruning — importsgetEarlyPruneRegexand, in theProgramvisitor after theincludefilter, readspath.hub.getCode()and returns beforepath.traversewhenstate.opts.earlyPruningis truthy and no keyword regex matches;state.optsis merged withdefaultOptionsinpre, soearlyPruningdefaults totrue, matching the other entry points.test/early-pruning.test.ts— new coverage:earlyPruning: falsenames a marker-less file,truereturns the source unchanged, and each oftypegpu/tgpu/'use gpu'/"use gpu"triggers processing.test/obfuscation.test.ts— the metadata-only prune cases are split into[BABEL]/[ROLLUP]variants, with the prune case assertingcommon.functionVisitoris never read viavi.spyOn(..., 'get').test/auto-naming.test.ts— addsearlyPruning: falseto the marker-less "works with properties" Babel case, mirroring the existing rollup case.
Verification: 83/83 tests pass across the three touched test files, test:types is clean, and oxlint/oxfmt --check report no issues.
One thing worth keeping in mind (not a blocker): the Babel plugin now prunes by default, so marker-less files that rely on forceTgpuAlias (or otherwise omit the literal keywords) are no longer transformed unless earlyPruning: false is set — the same tradeoff the other entry points already document. The Options docblock covers this generically.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — the branch was rebased from 4ee0d92 to ffadf588 with no content change (all four per-file diff blob hashes are byte-identical to the prior review), so there is no new delta to cover. The initial review stands: the Babel Program-visitor early prune, the new early-pruning test file, and the split [BABEL]/[ROLLUP] obfuscation cases are all correct, and the affected tests, test:types, oxlint and oxfmt pass.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
ffadf58 to
329468e
Compare

No description provided.