Skip to content

Conversation

@xusd320
Copy link
Contributor

@xusd320 xusd320 commented Jan 16, 2026

Update next.js submodule with resolve plugin optimizations. See utooland/next.js#100 for details. Performance: -2.2% to -9.1% turbo_tasks::function time.

Update next.js submodule with resolve plugin optimizations:
- Pre-fetch options once in resolve_inline
- Early return for empty plugin lists
- Pre-resolve plugin conditions before loop
- Consistent package_json().resolve().await? for cache hits
- Early return for empty in_package rules

Performance improvement:
- turbo_tasks::function: -2.2% avg, -9.1% best
- turbo_tasks::resolve_call: -3.6% avg, -13.9% best
- read file: -43.6% avg, -59.7% best

See: utooland/next.js#100
@gemini-code-assist
Copy link
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 integrates critical performance optimizations into Turbopack's module resolution process by updating the next.js submodule. The changes specifically target the handling of resolve plugins and file I/O operations, leading to measurable improvements in key performance metrics and overall build efficiency.

Highlights

  • Optimized Turbopack Resolve Plugin Handling: Implemented several targeted optimizations in the Turbopack core's resolve plugin handling logic to improve efficiency and reduce overhead.
  • Significant Performance Improvements: Achieved notable performance gains, including a 2.2% to 9.1% reduction in turbo_tasks::function time, a 3.6% to 13.9% reduction in turbo_tasks::resolve_call time, and a substantial 43.6% to 59.7% reduction in read file time.
  • Next.js Submodule Update: The next.js submodule has been updated to integrate these performance enhancements, ensuring they are applied to projects using Next.js with Turbopack.
  • Detailed Performance Report Added: A comprehensive performance analysis report has been added, outlining the identified bottlenecks, the specific optimizations implemented, and their measured impact on build performance.
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.

Copy link
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 the next.js submodule to incorporate performance optimizations in the Turbopack resolve plugin handling, as detailed in the newly added performance report. The changes result in a notable performance improvement, especially a significant reduction in read file operations.

My review focuses on the clarity and completeness of the performance report. I've suggested minor improvements to make the report easier to understand, such as addressing the skipped section numbering and adding more context to the performance gains.


---

## 🔍 Tier 4: The Asset Processing Pipeline (P3)
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The report jumps from 'Tier 2' to 'Tier 4', and from section 'C' to 'G'. This can be confusing for readers. If sections are omitted when there's nothing to report, it would be helpful to either add a note explaining this or re-number the existing sections to be sequential (e.g., Tier 3, Section D).

| `turbo_tasks::function` | 18,459ms | 18,047ms | 16,784ms | **-2.2%** | **-9.1%** |
| `turbo_tasks::resolve_call` | 4,398ms | 4,240ms | 3,785ms | **-3.6%** | **-13.9%** |
| `read file` | 1,883ms | 1,062ms | 759ms | **-43.6%** | **-59.7%** |

Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The improvement in read file is very significant. To improve clarity, consider adding a brief analysis here explaining how the implemented optimizations in the resolve plugin led to this substantial reduction in file reads. For example, you could mention that pre-resolving plugin conditions avoided many conditional file system checks.

@xusd320 xusd320 force-pushed the perf/optimize-resolve-plugins branch from 7c22803 to 8d2fe38 Compare January 17, 2026 09:22
@xusd320 xusd320 merged commit 6dcdf34 into next Jan 17, 2026
22 checks passed
@xusd320 xusd320 deleted the perf/optimize-resolve-plugins branch January 17, 2026 09:22
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