Skip to content

perf(pack): loginfo for devServer#2781

Merged
fireairforce merged 2 commits intonextfrom
fix-print-info
Apr 14, 2026
Merged

perf(pack): loginfo for devServer#2781
fireairforce merged 2 commits intonextfrom
fix-print-info

Conversation

@fireairforce
Copy link
Copy Markdown
Member

Summary

before:

image

after:

image

Test Plan

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 refactors the printServerInfo utility by introducing a fixed box width constant and helper functions to handle the console output formatting. The review feedback recommends consolidating the helper functions into a single printBoxLine utility that uses a regular expression to strip ANSI escape codes, allowing for more robust padding calculations and cleaner styling of the server information box.

@github-actions
Copy link
Copy Markdown

📊 Performance Benchmark Report (with-antd)

Utoopack Performance Report

Report ID: utoopack_performance_report_20260413_084641
Generated: 2026-04-13 08:46:41
Trace File: trace_antd.json (0.6GB, 1.61M spans)
Test Project: examples/with-antd


Executive Summary

Metric Value Assessment
Total Wall Time 13,558.7 ms Baseline
Total Thread Work (de-duped) 28,713.1 ms Non-overlapping busy time
Effective Parallelism 2.1x thread_work / wall_time
Working Threads 5 Threads with actual spans
Thread Utilization 42.4% ⚠️ Suboptimal
Total Spans 1,607,554 All B/E + X events
Meaningful Spans (>= 10us) 537,241 (33.4% of total)
Tracing Noise (< 10us) 1,070,313 (66.6% 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 130,016 3,638.7 2,920.2 8,863.7
Parse 12,208 1,748.0 1,483.3 13,449.3
Analyze 312,268 17,457.5 12,475.7 13,038.4
Chunk 29,447 2,483.9 2,281.8 8,240.3
Codegen 41,250 4,927.6 3,718.2 8,334.2
Emit 75 69.5 35.2 8,529.1
Other 11,977 1,838.0 1,633.1 13,558.7

Workload Distribution by Diagnostic Tier

Category Spans Inclusive (ms) % Work Self-Time (ms) % Self
P0: Scheduling & Resolution 450,797 22,410.9 78.1% 16,527.8 57.6%
P1: I/O & Heavy Tasks 3,281 156.3 0.5% 122.0 0.4%
P2: Architecture (Locks/Memory) 0 0.0 0.0% 0.0 0.0%
P3: Asset Pipeline 81,424 9,171.6 31.9% 7,495.4 26.1%
P4: Bridge/Interop 0 0.0 0.0% 0.0 0.0%
Other 1,739 424.4 1.5% 402.2 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
6,680.0 7,890.3 177,938 37.5 0.1 26.4 23.3% module write all entrypoints to disk (1%)
2,946.9 3,913.8 40,421 72.9 0.2 306.2 10.3% analyze ecmascript module process module (75%)
1,757.0 2,966.5 23,030 76.3 0.3 48.0 6.1% code generation chunking (8%)
1,666.9 1,666.9 16,137 103.3 0.4 9.6 5.8% precompute code generation code generation (45%)
1,654.2 1,787.2 65,159 25.4 0.0 7.0 5.8% internal resolving resolving (30%)
1,505.1 1,670.7 15,876 94.8 0.2 59.8 5.2% chunking write all entrypoints to disk (0%)
1,454.4 4,222.6 76,066 19.1 0.0 5.1 5.1% process module module (15%)
1,257.8 1,843.4 64,170 19.6 0.0 8.0 4.4% resolving module (36%)
1,225.4 1,225.4 14,761 83.0 0.3 141.4 4.3% compute async module info chunking (0%)
1,196.4 1,374.3 9,317 128.4 0.0 251.8 4.2% write all entrypoints to disk None (0%)
1,111.4 1,182.4 8,822 126.0 0.5 38.7 3.9% parse ecmascript analyze ecmascript module (26%)
746.4 748.8 13,420 55.6 0.0 57.8 2.6% compute async chunks compute async chunks (0%)
372.4 388.3 1,552 240.0 0.9 14.9 1.3% webpack loader parse css (10%)
294.3 294.3 2,083 141.3 0.4 16.4 1.0% generate source map code generation (96%)
293.3 486.9 867 338.3 1.8 29.9 1.0% parse css module (5%)
90.8 90.8 1,038 87.4 0.0 21.3 0.3% compute binding usage info write all entrypoints to disk (0%)
77.4 77.4 2,505 30.9 0.0 5.4 0.3% read file parse ecmascript (85%)
63.0 63.0 2,018 31.2 0.0 19.8 0.2% collect mergeable modules compute merged modules (0%)
34.4 39.3 921 37.4 0.1 2.9 0.1% async reference write all entrypoints to disk (1%)
32.3 32.3 36 897.6 4.4 11.1 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 306.3 2 process module → analyze ecmascript module
2 62.5 2 code generation → generate source map
3 58.0 2 code generation → generate source map
4 51.4 2 process module → analyze ecmascript module
5 45.9 2 process module → analyze ecmascript module

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 40,421 process module (75%) 72.9 us 0.15 ms 2,946.9 ms

Duration Distribution

Range Count Percentage
<10us 1,070,313 66.6%
10us-100us 506,571 31.5%
100us-1ms 26,197 1.6%
1ms-10ms 4,343 0.3%
10ms-100ms 124 0.0%
>100ms 6 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

@fireairforce fireairforce merged commit 4234078 into next Apr 14, 2026
23 checks passed
@fireairforce fireairforce deleted the fix-print-info branch April 14, 2026 03:14
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