Skip to content

perf(pack): optimize tracing overhead - #2468

Merged
xusd320 merged 1 commit into
nextfrom
perf/optimize-tracing
Dec 30, 2025
Merged

perf(pack): optimize tracing overhead#2468
xusd320 merged 1 commit into
nextfrom
perf/optimize-tracing

Conversation

@xusd320

@xusd320 xusd320 commented Dec 29, 2025

Copy link
Copy Markdown
Contributor

Improve performance by 30%

  • Before:
image
  • After:
image

@xusd320 xusd320 changed the title perf: optimize tracing overhead perf(pack): optimize tracing overhead Dec 29, 2025
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @xusd320, 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 aims to improve the performance and debuggability of the system by fine-tuning its tracing mechanisms and optimizing dependency management. It makes tracing more verbose by default for deeper insights during development and debugging, while simultaneously reducing logging overhead by removing redundant span close events. Additionally, it refines project dependencies by disabling unnecessary features and updating versions, and brings the next.js submodule up to date.

Highlights

  • Enhanced Tracing Verbosity: The default tracing/logging level has been changed from "info" to "trace" across various core functionalities, including project initialization, updates, transformations, and subscriptions. This provides more detailed logs for debugging and profiling purposes.
  • Reduced Tracing Overhead: Span close event logging (.with_span_events(FmtSpan::CLOSE)) has been removed from tracing subscriber initializations in pack-cli, pack-napi, and utoo-wasm. This change aims to streamline log output and potentially reduce logging overhead.
  • Optimized Dependency Features: The turbopack-node dependency in crates/pack-api/Cargo.toml and crates/pack-core/Cargo.toml now explicitly disables default features (default-features = false). This is likely to reduce build size or avoid unnecessary features.
  • Dependency Updates: Several dependencies in Cargo.lock have been updated, including libz-rs-sys (from 0.5.2 to 0.5.5), napi-build (from 2.2.3 to 2.3.1), and zlib-rs (from 0.5.2 to 0.5.5). Additionally, the itertools dependency version for proc-macro-crate was adjusted from 0.14.0 to 0.13.0.
  • Submodule Update: The next.js submodule has been updated to a newer commit (f6bb3c971e72caf1c1263fee9b0cb218ed89ce80).

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

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.

@xusd320
xusd320 force-pushed the perf/optimize-tracing branch from e192947 to fd22e43 Compare December 29, 2025 17:30

@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 effectively reduces tracing overhead by lowering the default logging level from info to trace across various parts of the codebase and by removing span close events from tracing initializations. These changes will provide more detailed logs for debugging and profiling. The dependency updates, including disabling default features for turbopack-node, are also aligned with performance optimization.

My review identifies a couple of places where the fallback tracing level was not updated from info to trace, which would be a good addition for consistency with the PR's goal. Overall, this is a good performance-focused change.

@@ -101,7 +101,6 @@ fn main() {
.unwrap_or_else(|_| EnvFilter::new("pack_cli=info,pack_api=info")),

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.

medium

To maintain consistency with the pull request's objective of lowering the default tracing level, it would be beneficial to also change the fallback EnvFilter from info to trace. This ensures more verbose logging is available by default for debugging purposes.

Suggested change
.unwrap_or_else(|_| EnvFilter::new("pack_cli=info,pack_api=info")),
.unwrap_or_else(|_| EnvFilter::new("pack_cli=trace,pack_api=trace")),

Comment thread crates/pack-napi/src/pack_api/project.rs
@xusd320
xusd320 force-pushed the perf/optimize-tracing branch 2 times, most recently from 80b50a4 to 373ea41 Compare December 30, 2025 03:17
@xusd320
xusd320 force-pushed the perf/optimize-tracing branch from 373ea41 to a36c593 Compare December 30, 2025 03:49
@xusd320
xusd320 force-pushed the perf/optimize-tracing branch from a36c593 to defd6d6 Compare December 30, 2025 03:59
@xusd320
xusd320 merged commit de55d52 into next Dec 30, 2025
21 checks passed
@xusd320
xusd320 deleted the perf/optimize-tracing branch December 30, 2025 04:25
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