Skip to content

feat(pack): bump turbopack & next.js#2820

Merged
xusd320 merged 5 commits intonextfrom
bump-turbopack-next
Apr 24, 2026
Merged

feat(pack): bump turbopack & next.js#2820
xusd320 merged 5 commits intonextfrom
bump-turbopack-next

Conversation

@fireairforce
Copy link
Copy Markdown
Member

Summary

just bump next.js & turbopack.

Test Plan

snapshot test case updated

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates various dependencies, including SWC and Wasmtime, and makes adjustments to the Turbopack runtime to improve module export handling and cross-origin configuration. I have reviewed the changes and identified an inconsistency in how the initializeApp export is registered compared to the default export in the generated output, which should be addressed for consistency.

Comment thread crates/pack-api/src/webpack_stats.rs Outdated
filename
}

#[cfg(feature = "test")]
Copy link
Copy Markdown
Contributor

@xusd320 xusd320 Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

没必要搞这么多层 cfg 吧,371行一个 cfg test 里调一下 sort_stats_fo_test 就好了

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我看一下

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done 了

[features]
default = ["process_pool"]
plugin = ["swc_core/plugin_transform_host_native", "turbopack-ecmascript-plugins/swc_ecma_transform_plugin"]
plugin = ["swc_core/plugin_transform_host_native"]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

上游的 swc wasm plugin 是不是切成 wasmtime 了,这个能大幅提升 rust 编译速度和减小二进制体积,看看我们要同步改什么

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个应该都改了:
image

@github-actions
Copy link
Copy Markdown

📊 Performance Benchmark Report (with-antd)

Utoopack Performance Report

Report ID: utoopack_performance_report_20260424_031643
Generated: 2026-04-24 03:16:43
Trace File: trace_antd.json (0.6GB, 1.62M spans)
Test Project: examples/with-antd


Executive Summary

Metric Value Assessment
Total Wall Time 10,731.5 ms Baseline
Total Thread Work (de-duped) 23,641.4 ms Non-overlapping busy time
Effective Parallelism 2.2x thread_work / wall_time
Working Threads 5 Threads with actual spans
Thread Utilization 44.1% ⚠️ Suboptimal
Total Spans 1,623,987 All B/E + X events
Meaningful Spans (>= 10us) 350,700 (21.6% of total)
Tracing Noise (< 10us) 1,273,287 (78.4% 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 76,220 2,384.3 1,932.6 7,124.7
Parse 9,634 2,578.3 1,975.4 10,613.3
Analyze 208,400 14,310.7 9,966.9 10,385.4
Chunk 19,349 1,935.7 1,789.3 7,423.6
Codegen 28,171 3,871.4 2,844.6 7,493.4
Emit 39 41.5 20.6 7,274.7
Other 8,887 1,098.0 922.7 10,731.5

Workload Distribution by Diagnostic Tier

Category Spans Inclusive (ms) % Work Self-Time (ms) % Self
P0: Scheduling & Resolution 291,004 17,387.9 73.5% 12,433.1 52.6%
P1: I/O & Heavy Tasks 3,023 534.9 2.3% 514.1 2.2%
P2: Architecture (Locks/Memory) 0 0.0 0.0% 0.0 0.0%
P3: Asset Pipeline 55,626 7,952.7 33.6% 6,176.6 26.1%
P4: Bridge/Interop 0 0.0 0.0% 0.0 0.0%
Other 1,047 344.3 1.5% 328.4 1.4%

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
5,250.3 6,091.5 110,731 47.4 0.1 25.8 22.2% module write all entrypoints to disk (1%)
2,653.8 3,709.3 34,800 76.3 0.1 153.6 11.2% analyze ecmascript module process module (80%)
1,644.8 2,671.6 16,534 99.5 0.4 46.1 7.0% code generation chunking (1%)
1,331.1 1,452.1 11,396 116.8 0.2 106.6 5.6% chunking write all entrypoints to disk (0%)
1,245.4 3,665.5 54,306 22.9 0.0 11.0 5.3% process module module (9%)
1,223.1 1,693.1 6,794 180.0 0.6 35.7 5.2% parse ecmascript analyze ecmascript module (32%)
1,073.7 1,158.2 41,861 25.6 0.0 9.0 4.5% internal resolving resolving (29%)
867.1 867.1 9,555 90.7 0.2 9.6 3.7% precompute code generation code generation (57%)
851.2 1,218.3 33,726 25.2 0.0 10.1 3.6% resolving module (12%)
727.6 727.6 6,905 105.4 0.4 61.2 3.1% compute async module info chunking (0%)
569.1 726.7 7,291 78.1 0.0 118.9 2.4% write all entrypoints to disk None (0%)
485.6 485.6 2,340 207.5 1.0 15.4 2.1% read file parse ecmascript (91%)
441.6 442.1 7,866 56.1 0.0 41.3 1.9% compute async chunks compute async chunks (0%)
332.7 332.7 2,082 159.8 0.4 16.1 1.4% generate source map code generation (96%)
288.1 296.1 941 306.2 1.7 19.4 1.2% webpack loader parse css (9%)
266.6 399.5 489 545.1 2.9 22.4 1.1% parse css module (9%)
53.1 53.1 823 64.5 0.0 12.9 0.2% compute binding usage info write all entrypoints to disk (0%)
25.2 26.9 549 45.9 0.1 3.1 0.1% async reference write all entrypoints to disk (1%)
21.8 21.8 808 27.0 0.0 7.1 0.1% collect mergeable modules compute merged modules (0%)
20.3 20.3 36 563.2 3.0 6.3 0.1% write file apply effects (100%)

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 153.7 2 process module → analyze ecmascript module
2 77.2 2 process module → analyze ecmascript module
3 62.2 2 code generation → generate source map
4 51.8 2 process module → analyze ecmascript module
5 42.0 2 code generation → 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
analyze ecmascript module 34,800 process module (80%) 76.3 us 0.14 ms 2,653.8 ms

Duration Distribution

Range Count Percentage
<10us 1,273,287 78.4%
10us-100us 327,250 20.2%
100us-1ms 19,019 1.2%
1ms-10ms 4,299 0.3%
10ms-100ms 128 0.0%
>100ms 4 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

@xusd320 xusd320 merged commit d090939 into next Apr 24, 2026
23 checks passed
@xusd320 xusd320 deleted the bump-turbopack-next branch April 24, 2026 03:49
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.

2 participants