Skip to content

fix(pack): preserve IE11 UMD runtime semantics - #3412

Draft
fireairforce wants to merge 8 commits into
nextfrom
zoomdong/umd-webpack-compat
Draft

fireairforce wants to merge 8 commits into
nextfrom
zoomdong/umd-webpack-compat

Conversation

@fireairforce

@fireairforce fireairforce commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

IE11 UMD builds could emit arrows or require unsupported runtime APIs. Preserve strict for-of behavior with IE-targeted fallbacks and support dynamic CommonJS star re-exports with live getters without Proxy.

Runtime dependency: utooland/next.js#204. Refresh the affected generated snapshots, including content hashes, source maps and stats.

Validation: all 158 Pack snapshot tests and 2 integration tests; full minified UMD ES5 parsing and VM assertions without Symbol, URL, Proxy or includes; format, Biome, Tombi and typos. IE11 browser execution remains untested.

Base automatically changed from zoomdong/fix-inline-css-sourcemaps to next October 14, 2026 11:56
@github-actions

Copy link
Copy Markdown

📊 Performance Benchmark Report (with-antd)

Utoopack Performance Report

Report ID: utoopack_performance_report_20261014_135527
Generated: 2026-10-14 13:55:27
Trace File: trace_antd.json (0.3GB, 0.84M spans)
Test Project: examples/with-antd


Executive Summary

Metric Value Assessment
Total Wall Time 7,278.3 ms Baseline
Total Thread Work (de-duped) 21,463.9 ms Non-overlapping busy time
Effective Parallelism 2.9x thread_work / wall_time
Working Threads 10 Threads with actual spans
Thread Utilization 29.5% ⚠️ Suboptimal
Total Spans 844,913 All B/E + X events
Meaningful Spans (>= 10us) 222,173 (26.3% of total)
Tracing Noise (< 10us) 622,740 (73.7% of total)

Build Phase Timeline

Shows when each build phase is active and how much CPU it consumes.
Self-Time is the time spent exclusively in that phase (excluding children).

Phase Spans Inclusive (ms) Self-Time (ms) Wall Range (ms)
Resolve 48,661 6,778.7 1,898.9 3,345.5
Parse 8,169 1,576.7 1,166.4 6,519.1
Analyze 143,629 43,481.9 9,587.9 6,430.7
Chunk 5,553 5,918.8 860.0 2,702.0
Codegen 12,937 2,614.9 1,705.2 2,286.8
Emit 33 41.3 20.7 8.6
Other 3,191 8,303.6 4,591.2 7,278.3

Workload Distribution by Diagnostic Tier

Category Spans Inclusive (ms) % Work Self-Time (ms) % Self
P0: Scheduling & Resolution 192,770 50,896.5 237.1% 11,755.6 54.8%
P1: I/O & Heavy Tasks 2,902 134.9 0.6% 114.2 0.5%
P2: Architecture (Locks/Memory) 0 0.0 0.0% 0.0 0.0%
P3: Asset Pipeline 25,235 10,177.0 47.4% 3,782.4 17.6%
P4: Bridge/Interop 0 0.0 0.0% 0.0 0.0%
Other 1,266 7,507.7 35.0% 4,178.0 19.5%

Top 20 Tasks by Self-Time

Self-time is the exclusive duration: time spent in the task itself, not in sub-tasks.
This is the most accurate indicator of where CPU cycles are actually spent.

Self (ms) Inclusive (ms) Count Avg Self (us) P95 Self (ms) Max Self (ms) % Work Task Name Top Caller
4,568.2 25,274.3 97,167 47.0 0.1 13.8 21.3% module module (60%)
2,575.8 3,006.4 24 107325.0 355.3 456.1 12.0% save snapshot persist (4%)
2,467.1 2,587.6 2,410 1023.7 3.1 378.0 11.5% analyze ecmascript module module (72%)
1,517.9 14,320.4 34,278 44.3 0.1 6.8 7.1% process module process module (81%)
1,224.9 3,271.1 25,921 47.3 0.1 5.1 5.7% internal resolving internal resolving (75%)
1,088.2 1,498.6 5,999 181.4 0.7 74.9 5.1% parse ecmascript parse ecmascript (66%)
959.1 1,036.8 10,638 90.2 0.4 6.5 4.5% precompute code generation generate merged code (48%)
828.1 941.4 7,148 115.8 0.4 178.9 3.9% compute async module info compute async module info (57%)
732.9 2,428.1 988 741.8 1.7 291.9 3.4% generate merged code chunking (45%)
665.0 5,518.1 4,110 161.8 0.2 42.5 3.1% chunking chunking (51%)
658.6 3,492.2 22,041 29.9 0.0 4.4 3.1% resolving module (57%)
516.7 516.7 329 1570.6 1.2 278.1 2.4% generate source map code generation (83%)
432.6 432.6 9 48063.8 211.9 243.3 2.0% blocking save snapshot (67%)
406.6 881.3 129 3152.3 5.0 237.7 1.9% emit code generate merged code (41%)
382.3 661.4 1,521 251.3 0.1 230.4 1.8% write all entrypoints to disk write all entrypoints to disk (12%)
229.4 1,061.4 1,970 116.4 0.2 56.5 1.1% code generation code generation (84%)
190.8 396.0 1,374 138.9 0.2 26.4 0.9% compute async chunks compute async chunks (43%)
129.0 144.7 746 172.9 0.0 51.2 0.6% compute binding usage info compute binding usage info (51%)
78.1 78.1 2,167 36.0 0.1 2.2 0.4% read file parse ecmascript (91%)
60.7 108.9 1,861 32.6 0.0 16.9 0.3% collect mergeable modules collect mergeable modules (98%)

Critical Path Analysis

The longest sequential dependency chains that determine wall-clock time.
Focus on reducing the depth of these chains to improve parallelism.

Rank Self-Time (ms) Depth Path
1 699.6 3 persist → save snapshot → blocking
2 533.2 6 chunking → generate merged code → emit code → emit code → emit code → read file
3 378.2 3 process module → process module → analyze ecmascript module
4 366.9 2 save snapshot → blocking
5 325.6 4 chunking → generate merged code → emit code → generate source map

Batching Candidates

High-volume tasks dominated by a single parent. If the parent can batch them,
it drastically reduces scheduler overhead.

Task Name Count Top Caller (Attribution) Avg Self P95 Self Total Self
process module 34,278 process module (81%) 44.3 us 0.07 ms 1,517.9 ms
internal resolving 25,921 internal resolving (75%) 47.3 us 0.09 ms 1,224.9 ms

Duration Distribution

Range Count Percentage
<10us 622,740 73.7%
10us-100us 144,320 17.1%
100us-1ms 65,925 7.8%
1ms-10ms 11,688 1.4%
10ms-100ms 201 0.0%
>100ms 39 0.0%

Action Items

  1. [P0] Focus on tasks with the highest Self-Time — these are where CPU cycles are actually spent.
  2. [P0] Use Batching Candidates to identify callers that should use try_join or reduce #[turbo_tasks::function] granularity.
  3. [P1] Check Build Phase Timeline for phases with disproportionate wall range vs. self-time (= serialization).
  4. [P1] Inspect P95 Self (ms) for heavy monolith tasks. Focus on long-tail outliers, not averages.
  5. [P1] Review Critical Paths — reducing the longest chain depth directly improves wall-clock time.
  6. [P2] If Thread Utilization < 60%, investigate scheduling gaps (lock contention or deep dependency chains).

Report generated by Utoopack Performance Analysis Agent

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