Skip to content

Use the new "durability" infrastructure from salsa #1445

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 3 commits into from
Aug 15, 2019
Merged

Use the new "durability" infrastructure from salsa #1445

merged 3 commits into from
Aug 15, 2019

Conversation

matklad
Copy link
Member

@matklad matklad commented Jun 26, 2019

Based on https://github.com/nikomatsakis/salsa/tree/durability

Durability allows us to skip validation work for sysroot and crates.io libraries, which massively speeds up some workloads

@matklad
Copy link
Member Author

matklad commented Jun 26, 2019

Some numbers:

$ cargo run --release -p ra_cli -- analysis-bench . --complete ./crates/ra_hir/src/ty/infer.rs:1437:0
loading: 324.317783ms

from scratch:   15.432856125s
no change:      359.759µs
trivial change: 3.103853ms
comment change: 11.334281ms
const change:   101.016624ms

previously, what we were doing was basically const change entry. With this PR, we do what comment change does.

eprint!("comment change: ");
{
let mut text = host.analysis().file_text(file_id).to_string();
text.push_str("\n/* Hello world */\n");
Copy link
Member

Choose a reason for hiding this comment

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

a slightly more interesting change might be putting the comment at the top?

Copy link
Member Author

Choose a reason for hiding this comment

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

That would be harder to implement, because I would need to adjust offset for subsequent queries.

ideally, we should accept a .patch file as a command line argument...

@matklad matklad force-pushed the durability branch 6 times, most recently from 61b0c1c to b3d791d Compare June 30, 2019 20:34
@matklad matklad force-pushed the durability branch 7 times, most recently from 4086608 to 3b312b4 Compare July 9, 2019 08:34
@matklad matklad force-pushed the durability branch 8 times, most recently from a4f06ba to bdd9b11 Compare July 24, 2019 11:22
@matklad matklad marked this pull request as ready for review August 15, 2019 12:33
@matklad
Copy link
Member Author

matklad commented Aug 15, 2019

bors r+

bors bot added a commit that referenced this pull request Aug 15, 2019
1445: Use the new "durability" infrastructure from salsa r=matklad a=matklad

Based on https://github.com/nikomatsakis/salsa/tree/durability

Durability allows us to skip *validation* work for sysroot and crates.io libraries, which massively speeds up some workloads



Co-authored-by: Aleksey Kladov <[email protected]>
@bors
Copy link
Contributor

bors bot commented Aug 15, 2019

Build succeeded

@bors bors bot merged commit 1700541 into master Aug 15, 2019
@bors bors bot deleted the durability branch August 15, 2019 12:48
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