Auto merge of #16335 - lnicola:salsa-lz4-file-text, r=Veykril

internal: Compress file text using LZ4

I haven't tested properly, but this roughly looks like:

```
1246 MB
    59mb   4899 FileTextQuery

1008 MB
    20mb   4899 CompressedFileTextQuery
   555kb   1790 FileTextQuery
```

We might want to test on something more interesting, like `bevy`.
This commit is contained in:
bors 2024-03-11 13:43:33 +00:00
commit 8f8bcfc131
16 changed files with 89 additions and 36 deletions

View file

@ -361,8 +361,8 @@ fn load_crate_graph(
let changes = vfs.take_changes();
for file in changes {
if let vfs::Change::Create(v) | vfs::Change::Modify(v) = file.change {
if let Ok(text) = std::str::from_utf8(&v) {
analysis_change.change_file(file.file_id, Some(text.into()))
if let Ok(text) = String::from_utf8(v) {
analysis_change.change_file(file.file_id, Some(text))
}
}
}