Skip to content

Commit

Permalink
major completions performance improvement (4x)
Browse files Browse the repository at this point in the history
  • Loading branch information
Feel-ix-343 committed Apr 1, 2024
1 parent 5f5a0d1 commit 57b6aa6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/completion/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ fn run_completer<'a, T: Completer<'a>>(

let completions = completions
.into_iter()
.take(10)
.take(20)
.flat_map(|completable| {
completable
.completions(&completer)
Expand Down
4 changes: 3 additions & 1 deletion src/vault/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ impl Vault {

Some(
references
.into_iter()
.into_par_iter()
.filter(|(ref_path, reference)| {
referenceable.matches_reference(&self.root_dir, reference, ref_path)
})
Expand All @@ -336,6 +336,8 @@ impl Vault {
Err(_) => (path, reference, SystemTime::UNIX_EPOCH),
}
})
.collect::<Vec<_>>()
.into_iter()
.sorted_by_key(|(_, _, modified)| *modified)
.rev()
.map(|(one, two, _)| (one, two))
Expand Down

0 comments on commit 57b6aa6

Please sign in to comment.