perf: inline is_absolute check with comment at resolve call sites#8437
Merged
hyf0 merged 4 commits intoperf/reduce-path-allocationsfrom Feb 24, 2026
Merged
perf: inline is_absolute check with comment at resolve call sites#8437hyf0 merged 4 commits intoperf/reduce-path-allocationsfrom
hyf0 merged 4 commits intoperf/reduce-path-allocationsfrom
Conversation
…elpers Co-authored-by: hyf0 <[email protected]>
Copilot
AI
changed the title
[WIP] Add functions for clearer optimization intent
perf(resolver): extract Feb 24, 2026
resolve_file_from_importer helpers to clarify optimization intent
… site Co-authored-by: hyf0 <[email protected]>
Copilot
AI
changed the title
perf(resolver): extract
perf: inline is_absolute check with comment at resolve call sites
Feb 24, 2026
resolve_file_from_importer helpers to clarify optimization intent
hyf0
reviewed
Feb 24, 2026
| } | ||
| } | ||
|
|
||
| /// Infer module format from file extension and package.json type field |
Co-authored-by: hyf0 <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR applies a small performance-oriented refactor in the resolver paths by inlining the “absolute importer” fast-path at resolve call sites and documenting the intent, while also restoring the infer_module_def_format doc comment.
Changes:
- Inline the
is_absolutecheck at resolve call sites to avoid allocating viajoinwhen the importer is already absolute. - Remove the
resolve_file_from_importerhelper (verified no remaining references). - Restore the doc comment on
infer_module_def_format.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| crates/rolldown_resolver/src/resolver.rs | Adds an is_absolute fast-path when resolving with an importer and keeps infer_module_def_format documentation. |
| crates/rolldown_plugin_vite_resolve/src/resolver.rs | Adds the same is_absolute fast-path at both resolve call sites in the Vite resolver implementation. |
Contributor
Benchmarks Rust |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
resolve_file_from_importerincrates/rolldown_resolver/src/resolver.rswith comment, remove helper functionresolve_file_from_importer(2 call sites) incrates/rolldown_plugin_vite_resolve/src/resolver.rswith comment, remove helper functioninfer_module_def_format💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.