Avoid cloning Name when looking up function and class types#14092
Merged
MichaReiser merged 1 commit intomainfrom Nov 4, 2024
Merged
Avoid cloning Name when looking up function and class types#14092MichaReiser merged 1 commit intomainfrom
Name when looking up function and class types#14092MichaReiser merged 1 commit intomainfrom
Conversation
9eb80d6 to
6a6131b
Compare
AlexWaygood
approved these changes
Nov 4, 2024
Contributor
|
Contributor
Was it? I don't see any CodSpeed results reported here. |
Member
Author
|
Nope, this wasn't it :) |
carljm
added a commit
to Glyphack/ruff
that referenced
this pull request
Nov 5, 2024
* main: (39 commits) Also remove trailing comma while fixing C409 and C419 (astral-sh#14097) Re-enable clippy `useless-format` (astral-sh#14095) Derive message formats macro support to string (astral-sh#14093) Avoid cloning `Name` when looking up function and class types (astral-sh#14092) Replace `format!` without parameters with `.to_string()` (astral-sh#14090) [red-knot] Do not panic when encountering string annotations (astral-sh#14091) [red-knot] Add MRO resolution for classes (astral-sh#14027) [red-knot] Remove `Type::None` (astral-sh#14024) Cached inference of all definitions in an unpacking (astral-sh#13979) Update dependency uuid to v11 (astral-sh#14084) Update Rust crate notify to v7 (astral-sh#14083) Update cloudflare/wrangler-action action to v3.11.0 (astral-sh#14080) Update dependency mdformat-mkdocs to v3.1.1 (astral-sh#14081) Update pre-commit dependencies (astral-sh#14082) Update dependency ruff to v0.7.2 (astral-sh#14077) Update NPM Development dependencies (astral-sh#14078) Update Rust crate thiserror to v1.0.67 (astral-sh#14076) Update Rust crate syn to v2.0.87 (astral-sh#14075) Update Rust crate serde to v1.0.214 (astral-sh#14074) Update Rust crate pep440_rs to v0.7.2 (astral-sh#14073) ...
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.
Summary
Uses Salsa's new
Lookupfunctionality forFunctionTypeandClassTypenames.The
Lookuptrait allows looking-up interned values by a borrowed value. In this casewe can lookup the interned type using the borrowed
strand only allocate the owned `Name`` whenthe type doesn't already exist.
This was part of #14087 but I extracted it into its own PR to see if it is the reason for the significant incremental perf improvement.
Test Plan
cargo test