Skip to content

feat: Add toggle to disable cache priming #10810

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 20, 2021

Conversation

lnicola
Copy link
Member

@lnicola lnicola commented Nov 19, 2021

Even if it doesn't prevent the rest of the features from working, cache priming tends to be quite CPU-intensive and can make people think that the load times are worse than they actually are.

It's also less useful in Code and rust-tools because the inlay hints and semantic highlighting trigger quite a bit of computation assuming you have a file open in the editor.

@@ -215,6 +215,9 @@ config_data! {
/// Join lines merges consecutive declaration and initialization of an assignment.
joinLines_joinAssignments: bool = "true",

/// Pre-fill caches on project load.
load_prefillCaches: bool = "true",
Copy link
Member Author

@lnicola lnicola Nov 19, 2021

Choose a reason for hiding this comment

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

TODO: bikeshed this.

Copy link
Member

Choose a reason for hiding this comment

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

rust-analyzer.cache.prefill?

Copy link
Contributor

Choose a reason for hiding this comment

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

This is often called cache warmup.

Copy link
Member

Choose a reason for hiding this comment

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

rust-analyzer.cache.warmup would also be good.

@lnicola lnicola changed the title Add toggle to disable cache priming feat: Add toggle to disable cache priming Nov 19, 2021
@lnicola lnicola force-pushed the optional-priming branch 2 times, most recently from a118e08 to c62e500 Compare November 19, 2021 17:16
@lnicola
Copy link
Member Author

lnicola commented Nov 20, 2021

r? @jonas-schievink

@jonas-schievink
Copy link
Contributor

bors r+

@bors
Copy link
Contributor

bors bot commented Nov 20, 2021

@bors bors bot merged commit 4566414 into rust-lang:master Nov 20, 2021
@lnicola lnicola deleted the optional-priming branch November 20, 2021 20:41
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.

4 participants