Skip to content

chore(pack): sync latest turbopack canary - #3326

Open
fireairforce wants to merge 5 commits into
nextfrom
zoomdong-sync-turbopack-20260829
Open

chore(pack): sync latest turbopack canary#3326
fireairforce wants to merge 5 commits into
nextfrom
zoomdong-sync-turbopack-20260829

Conversation

@fireairforce

Copy link
Copy Markdown
Member

Summary

  • Update the next.js submodule to utooland/next.js@9c274924f2, based on the current vercel/next.js@7421a868ad canary tip.
  • Preserve the Utoo WASM/browser-worker adaptations while resolving the latest TurboTasks and Turbopack APIs, then refresh the generated @utoo/web binding declarations.
  • Wire the new Pack module and resolver options: production export-name mangling, compact production CSS Module identifiers with readable development identifiers, and project-root resolution for server-relative requests.
  • Regenerate snapshots for the new 13-character base38 output hashes and add focused regressions for development CSS Module names and root-relative client/server imports.

Performance impact

  • Production ESM exports can now use shorter mangled names.
  • Production CSS Module identifiers no longer retain debug path prefixes, while development output stays readable.
  • The synced canary includes the latest Turbo persistence key-ordering and SST lookup optimization.

Verification

  • cargo fmt
  • cargo clippy --all-targets -- -D warnings --no-deps
  • cargo test -p pack-tests — 135 passed
  • npm run build:local --workspace @utoo/pack
  • npm test --workspace shared-runtime-async-module
  • npm run build:local --workspace @utoo/web
  • npx biome ci .
  • npx tombi format --check
  • typos
  • Submodule full clippy, turbo-persistence, turbo-rcstr, AssetIdent, native/WASI/browser-WASM targeted checks

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 29, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-29T12:33:33.307023Z f354f16 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f354f163cc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/pack-core/src/client/context.rs Outdated
@github-actions

Copy link
Copy Markdown

📊 Performance Benchmark Report (with-antd)

Utoopack Performance Report

Report ID: utoopack_performance_report_20260829_130800
Generated: 2026-08-29 13:08:00
Trace File: trace_antd.json (0.3GB, 0.82M spans)
Test Project: examples/with-antd


Executive Summary

Metric Value Assessment
Total Wall Time 6,225.8 ms Baseline
Total Thread Work (de-duped) 19,178.9 ms Non-overlapping busy time
Effective Parallelism 3.1x thread_work / wall_time
Working Threads 10 Threads with actual spans
Thread Utilization 30.8% ⚠️ Suboptimal
Total Spans 819,244 All B/E + X events
Meaningful Spans (>= 10us) 220,416 (26.9% of total)
Tracing Noise (< 10us) 598,828 (73.1% 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 50,274 7,121.2 1,921.9 3,197.4
Parse 8,172 1,342.2 1,007.4 5,704.3
Analyze 140,726 39,519.2 9,048.0 5,618.7
Chunk 5,767 5,509.1 917.5 2,210.6
Codegen 12,422 2,282.6 1,435.5 1,913.1
Emit 32 34.6 17.3 8.0
Other 3,023 5,904.7 3,257.1 6,225.8

Workload Distribution by Diagnostic Tier

Category Spans Inclusive (ms) % Work Self-Time (ms) % Self
P0: Scheduling & Resolution 191,382 47,149.2 245.8% 11,161.2 58.2%
P1: I/O & Heavy Tasks 2,903 96.3 0.5% 79.0 0.4%
P2: Architecture (Locks/Memory) 0 0.0 0.0% 0.0 0.0%
P3: Asset Pipeline 25,003 9,174.6 47.8% 3,382.7 17.6%
P4: Bridge/Interop 0 0.0 0.0% 0.0 0.0%
Other 1,128 5,293.5 27.6% 2,981.8 15.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,662.5 25,010.0 97,218 48.0 0.1 16.4 24.3% module module (62%)
2,184.4 2,341.3 2,456 889.4 2.9 228.4 11.4% analyze ecmascript module module (73%)
1,971.0 2,039.7 20 98550.7 297.6 446.4 10.3% save snapshot persist (5%)
1,356.6 11,056.8 31,131 43.6 0.1 5.7 7.1% process module process module (81%)
1,272.1 3,517.8 27,371 46.5 0.1 7.7 6.6% internal resolving internal resolving (77%)
954.3 1,289.1 6,003 159.0 0.6 44.8 5.0% parse ecmascript parse ecmascript (65%)
816.6 893.5 10,129 80.6 0.3 9.1 4.3% precompute code generation generate merged code (38%)
797.8 5,235.8 3,982 200.3 0.3 86.9 4.2% chunking chunking (44%)
711.5 857.7 7,210 98.7 0.4 90.7 3.7% compute async module info compute async module info (57%)
641.1 3,594.7 22,201 28.9 0.0 5.4 3.3% resolving module (55%)
585.5 1,950.2 861 680.1 1.8 223.7 3.1% generate merged code chunking (48%)
401.3 401.3 329 1219.7 0.9 240.3 2.1% generate source map code generation (83%)
328.9 710.5 130 2529.9 4.6 188.2 1.7% emit code generate merged code (42%)
249.5 474.0 1,561 159.8 0.1 123.2 1.3% write all entrypoints to disk write all entrypoints to disk (16%)
217.6 987.8 1,964 110.8 0.2 41.1 1.1% code generation code generation (81%)
116.6 269.5 1,736 67.2 0.1 9.3 0.6% compute async chunks compute async chunks (44%)
75.3 93.7 811 92.9 0.0 25.2 0.4% compute binding usage info compute binding usage info (47%)
71.0 71.0 7 10142.2 38.2 44.1 0.4% blocking save snapshot (43%)
53.1 53.1 2,166 24.5 0.0 0.4 0.3% read file parse ecmascript (91%)
44.7 79.1 1,873 23.9 0.0 16.0 0.2% collect mergeable modules collect mergeable modules (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 490.5 3 persist → save snapshot → blocking
2 412.9 6 chunking → generate merged code → emit code → emit code → emit code → read file
3 274.2 4 chunking → generate merged code → emit code → generate source map
4 228.5 3 process module → process module → analyze ecmascript module
5 154.5 2 save snapshot → blocking

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 31,131 process module (81%) 43.6 us 0.07 ms 1,356.6 ms
internal resolving 27,371 internal resolving (77%) 46.5 us 0.09 ms 1,272.1 ms

Duration Distribution

Range Count Percentage
<10us 598,828 73.1%
10us-100us 145,136 17.7%
100us-1ms 64,313 7.9%
1ms-10ms 10,746 1.3%
10ms-100ms 194 0.0%
>100ms 27 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