Skip to content

chore(pack): build log perf#2676

Merged
fireairforce merged 2 commits into
nextfrom
update-build-log
Mar 11, 2026
Merged

chore(pack): build log perf#2676
fireairforce merged 2 commits into
nextfrom
update-build-log

Conversation

@fireairforce

Copy link
Copy Markdown
Member

Summary

perf output log.

Test Plan

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request primarily refines the logging output for build processes, making it more succinct by reducing verbosity in completion messages. Additionally, it organizes and defines new TypeScript interfaces for internal error handling mechanisms, improving the clarity and structure of the API definitions for Turbopack callbacks.

Highlights

  • Performance Logging: Simplified the build completion log messages in the Rust pack-napi crate to provide a more concise output, focusing on the total compilation time rather than detailed counts of apps and libraries.
  • Error Handling API Definition: Introduced and relocated TypeScript interface definitions (TurbopackInternalErrorOpts and NapiTurbopackCallbacksJsObject) related to internal Turbopack error handling within the pack package's binding definitions.
Changelog
  • crates/pack-napi/src/pack_api/project.rs
    • Simplified the tracing::info! log message for project entrypoint writing.
    • Replaced a detailed tracing::info! log for pack task completion with a concise 'Compile done' message.
  • packages/pack/src/binding.d.ts
    • Added new TypeScript interfaces TurbopackInternalErrorOpts and NapiTurbopackCallbacksJsObject for internal error handling.
    • Removed a duplicate definition of TurbopackInternalErrorOpts from a later section of the file.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

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

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.

Code Review

This pull request aims to improve logging performance. It simplifies a log message in project.rs by removing details about compiled apps and libraries. While this might offer a minor performance gain, it reduces observability. I've suggested restoring this information in a more readable format. Additionally, a change in binding.d.ts has introduced a duplicate TypeScript interface definition, which will cause compilation errors and needs to be fixed.

Comment thread packages/pack/src/binding.d.ts
Comment thread crates/pack-napi/src/pack_api/project.rs
@fireairforce fireairforce enabled auto-merge (squash) March 11, 2026 03:50
@github-actions

Copy link
Copy Markdown

📊 Performance Benchmark Report (with-antd)

Utoopack Performance Report (Intelligent)

Report ID: utoopack_performance_report_20260311_035952
Generated: 2026-03-11 03:59:52
Trace File: trace_antd.json (0.6GB, 3.35M events)
Test Project: examples/with-antd


Executive Summary

Key Findings

Metric Value Assessment
Total Wall Time 8,412.5 ms Baseline
Total Thread Work (de-duped) 27,480.9 ms Non-overlapping busy time
Effective Parallelism 3.3x thread_work / wall_time
Working Threads 5 Threads with actual spans
Thread Utilization 65.3% 🆗 Average
Total Spans 1,674,327 All B/E + X events
Meaningful Spans (>= 10us) 568,737 (34.0% of total)
Tracing Noise (< 10us) 1,105,590 (66.0% of total)

Workload Distribution by Tier

Category Tasks Total Time (ms) % of Thread Work
P0: Runtime/Resolution 0 0.0 0.0%
P1: I/O & Heavy Tasks 39,687 3,837.2 14.0%
P3: Asset Pipeline 36,585 3,466.7 12.6%
P4: Bridge/Interop 0 0.0 0.0%
Other 492,465 22,483.6 81.8%

🤖 AI Intelligent Attributions

New section mapping granular tasks to bottlenecks.

Top 10 Batching Candidates

These highly-called tasks are dominated by a single parent. If the parent can batch them into one call, it drastically reduces scheduler overhead.

Task Name Count Top Caller (Attribution) Avg P95 Total Time
analyze ecmascript module 36,792 process module (76%) 102.3 us 0.28 ms 3,764.0 ms

Top 20 Tasks by Total Duration

Total (ms) Count Avg (us) P95 (ms) Max (ms) % Work Task Name Top Caller
8,162.4 207,391 39.4 0.1 10.3 29.7% module write all entrypoints to disk (1%)
4,042.0 70,451 57.4 0.1 208.7 14.7% process module module (16%)
3,764.0 36,792 102.3 0.3 208.6 13.7% analyze ecmascript module process module (76%)
2,725.2 24,699 110.3 0.4 62.7 9.9% code generation chunking (6%)
1,922.8 68,929 27.9 0.0 10.3 7.0% resolving module (29%)
1,765.3 64,329 27.4 0.0 5.6 6.4% internal resolving resolving (31%)
1,397.3 15,051 92.8 0.2 50.9 5.1% chunking write all entrypoints to disk (0%)
1,313.7 31,596 41.6 0.1 8.6 4.8% precompute code generation code generation (32%)
1,176.4 8,515 138.2 0.1 242.8 4.3% write all entrypoints to disk None (0%)
1,095.2 8,090 135.4 0.5 85.5 4.0% parse ecmascript analyze ecmascript module (26%)
1,055.9 13,286 79.5 0.3 110.4 3.8% compute async module info chunking (0%)
625.1 11,316 55.2 0.1 46.4 2.3% compute async chunks compute async chunks (0%)
270.3 1,936 139.6 0.4 16.2 1.0% generate source map code generation (96%)
73.6 652 113.0 0.0 22.8 0.3% compute binding usage info write all entrypoints to disk (0%)
64.7 2,167 29.9 0.0 3.4 0.2% read file parse ecmascript (91%)
64.0 186 344.0 1.1 19.6 0.2% make production chunks chunking (2%)
51.2 1,872 27.3 0.0 7.1 0.2% collect mergeable modules compute merged modules (0%)
42.4 14 3027.3 11.3 13.1 0.2% apply effects write all entrypoints to disk (7%)
41.7 13 3207.5 11.4 13.1 0.2% write file apply effects (100%)
41.3 608 67.9 0.1 4.1 0.2% async reference write all entrypoints to disk (1%)

Duration Distribution

Range Count Percentage
< 10us (noise) 1,105,590 66.0%
10us - 100us 542,497 32.4%
100us - 1ms 21,813 1.3%
1ms - 10ms 4,335 0.3%
10ms - 100ms 84 0.0%
> 100ms 8 0.0%

Action Items

  1. [P0] Use Batching Candidates to pinpoint specific files needing try_join or reduced #[turbo_tasks::function] limits.
  2. [P1] Inspect P95 (ms) for heavy monolith tasks. Focus on long-tail outliers rather than averages.

Report generated by Intelligent Utoopack Performance Analysis Agent

@fireairforce fireairforce merged commit 807fc10 into next Mar 11, 2026
21 checks passed
@fireairforce fireairforce deleted the update-build-log branch March 11, 2026 04:05
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