about summary refs log tree commit diff
path: root/src/tools/rust-analyzer/crates/base-db
AgeCommit message (Collapse)AuthorLines
2025-09-09Expand target info to include the architectureChayim Refael Friedman-7/+54
And make it easier to expand it more in the future, if needed.
2025-08-25Cache trait solving across queries in the same revisionChayim Refael Friedman-1/+27
Caching trait solving can do a lot to speed. Unfortunately it also consume a huge amount of memory. Therefore, as part of the migration to the new solver Jack Huey disabled caching of trait solving (he made the query transparent). The PR proposes a middle ground: do cache trait solving, but only for the same revision. This allows us to be safe because during a revision the inputs cannot change. The result is hopefully much better performance to features that tend to do a bulk of trait solving, and also repeat the same query (e.g. inference then IDE features). There is another limitation: results are only cached in the same thread, to remove the need for synchronization which will be expensive. More measurements are required to check whether it's better to use a synchronized global cache, or maybe stay with a thread-local cache but batch multiple feature requests (highlighting, inlay hints etc.) of the same file to the same thread. Alongside the actual cache we store the revision, because we need to verify it (we can't eagerly clear caches when incrementing the revision), and also the address of the db to prevent multiple dbs from interleaving (this is mostly relevant in tests, although injected highlighting also uses a new db, therefore maybe it's better to move it to a separate thread). This "games" analysis-stats to both be way faster and use way more memory; the former is because analysis-stats doesn't increment revisions, therefore all queries share the cache and hit ratio is way too good, the latter is because analysis-stats doesn't increment revisions and therefore the cache isn't cleared. Both are not representative of a typical IDE scenario.
2025-08-17fix: Make lang items query properly filter out overwritten/excluded sysrootsShoyu Vanilla-0/+2
2025-08-02When renaming a parameter to `self`, change callers to use method call syntaxChayim Refael Friedman-1/+2
2025-07-27fix: Consider all produced artifacts for proc-macro dylib searchLukas Wirth-10/+3
2025-07-27internal: Better type proc macro dylib build data stateLukas Wirth-5/+20
2025-07-03Bump salsaLukas Wirth-3/+3
2025-07-03Restructure proc-macro loading erros, differentiate hard error property on kindLukas Wirth-3/+47
2025-06-23Don't run doctestsChayim Refael Friedman-0/+1
2025-06-12`ItemTree`'s `ItemVisibilities` has no identity, so deduplicateLukas Wirth-3/+3
2025-05-23Bump salsaLukas Wirth-7/+9
2025-05-14Don't allow duplicate crates in the all_crates listChayim Refael Friedman-6/+13
For some reason we had them in some projects, I'm not sure why. But this caused cache priming to appear stuck - because it uses a set of crate IDs for the actual work, but for the number of crates to index it just uses `db.all_crates().len()`.
2025-04-30chore: Adjust panic context printingLukas Wirth-12/+10
2025-04-29Split out salsa_macrosLukas Wirth-9/+13
Does not do much yet due to tracing pulling syn but oh well
2025-04-29Update salsaLukas Wirth-6/+52
2025-04-28base-db: add more details to panicDavid Barsky-9/+20
2025-04-25`shrink_to_fit()` in more placesChayim Refael Friedman-2/+6
This saves 18mb on `analysis-stats .`, without regressing speed.
2025-04-22Adjust for new Salsa not implementing `Debug` by defaultChayim Refael Friedman-6/+6
2025-04-19Make `HirFileId`, `EditionedFileId` and macro files Salsa structChayim Refael Friedman-8/+28
And make more queries non-interned. Also flip the default for queries, now the default is to not intern and to intern a query you need to say `invoke_interned`.
2025-04-10Remove all upcasts!Chayim Refael Friedman-4/+0
It turns out there were a lot redundant too.
2025-04-06fix: Fix `format_args` lowering for >=1.87Lukas Wirth-0/+13
2025-04-04prefer default over newBenjaminBrienen-4/+0
2025-04-01chore: Remove unnecessary `Arc` clonesLukas Wirth-15/+15
2025-03-29fix: Fix, clarify and require a value for `proc_macro_cwd` of `CrateData`Lukas Wirth-14/+17
2025-03-26refactor: Use MEDIUM durability for crate-graph changes, high for library ↵Lukas Wirth-10/+14
source files The idea here is that the crate graph may change over time, but library source file contents *never* will (or really never should). Disconnecting the two means that queries that depend on library sources will not need to re-validatewhen the crate graph changes (unless they depend on the crate graph in some capacity).
2025-03-23chore: Remove unused dependenciesLukas Wirth-3/+0
2025-03-16refactor: Remove unnecessary `Arc`Lukas Wirth-4/+3
2025-03-16refactor: Remove `CrateGraphBuilder::iter_mut`Lukas Wirth-6/+1
2025-03-15cargo fmtBenjaminBrienen-44/+52
2025-03-15Merge pull request #19364 from Veykril/push-uonyorwwzpzxLukas Wirth-3/+7
fix: Fix missing `with_durability` calls
2025-03-15fix: Fix missing `with_durability` callsLukas Wirth-3/+7
2025-03-14Avoid recursively debug printing cratesFlorian Diebold-1/+2
2025-03-13internal: don't panic when the crate graph isn't ready #19351David Barsky-4/+3
2025-03-12Salsify the crate graphChayim Refael Friedman-196/+421
I.e. make it not one giant input but multiple, for incrementality and decreased memory usage for Salsa 3 reasons.
2025-03-10internal: port rust-analyzer to new SalsaDavid Barsky-123/+234
2025-02-27enable doctestBenjaminBrienen-1/+0
2025-02-17Use correct working directory for non-workspace proc-macro executionMehul Arora-14/+27
2025-02-04Expose symbol of `CrateName`Lukas Wirth-5/+5
2025-01-10minor: Fix grammar in doc commentsWilfred Hughes-1/+1
"too" should be "to" here.
2025-01-02Automatically sort crate graphlucasholten-9/+7
2024-12-31Add back optimizationslucasholten-4/+8
2024-12-31Add back crate graph deduplicationlucasholten-1/+4
2024-12-09Remove patch sysroot cfg-if hackLukas Wirth-23/+0
2024-10-14chore: rename salsa to ra_salsaDavid Barsky-17/+17
2024-10-05Remove ImportSource::ExternCrate as the fixed point loop can't affect itLukas Wirth-0/+5
2024-09-11Lift out workspace related data into a separate query to preserve crategraph ↵Lukas Wirth-8/+32
deduplication
2024-09-11Remove crate graph deduplication logicLukas Wirth-18/+4
2024-09-01minor: Downgrade cyclic deps error to warningLukas Wirth-47/+7
2024-08-27Revert "feat: Implement `module_path` macro"Lukas Wirth-1/+0
2024-08-21internal: Implement `module_path` macroLukas Wirth-0/+1