Show More
@@ -9,6 +9,12 b' source = "registry+https://github.com/ru' | |||
|
9 | 9 | checksum = "ee2a4ec343196209d6594e19543ae87a39f96d5534d7174822a3ad825dd6ed7e" |
|
10 | 10 | |
|
11 | 11 | [[package]] |
|
12 | name = "ahash" | |
|
13 | version = "0.4.7" | |
|
14 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
|
15 | checksum = "739f4a8db6605981345c5654f3a85b056ce52f37a39d34da03f25bf2151ea16e" | |
|
16 | ||
|
17 | [[package]] | |
|
12 | 18 | name = "aho-corasick" |
|
13 | 19 | version = "0.7.15" |
|
14 | 20 | source = "registry+https://github.com/rust-lang/crates.io-index" |
@@ -372,6 +378,16 b' source = "registry+https://github.com/ru' | |||
|
372 | 378 | checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" |
|
373 | 379 | |
|
374 | 380 | [[package]] |
|
381 | name = "hashbrown" | |
|
382 | version = "0.9.1" | |
|
383 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
|
384 | checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" | |
|
385 | dependencies = [ | |
|
386 | "ahash", | |
|
387 | "rayon", | |
|
388 | ] | |
|
389 | ||
|
390 | [[package]] | |
|
375 | 391 | name = "hermit-abi" |
|
376 | 392 | version = "0.1.17" |
|
377 | 393 | source = "registry+https://github.com/rust-lang/crates.io-index" |
@@ -398,6 +414,7 b' dependencies = [' | |||
|
398 | 414 | "derive_more", |
|
399 | 415 | "flate2", |
|
400 | 416 | "format-bytes", |
|
417 | "hashbrown", | |
|
401 | 418 | "home", |
|
402 | 419 | "im-rc", |
|
403 | 420 | "itertools", |
@@ -13,6 +13,7 b' bitflags = "1.2"' | |||
|
13 | 13 | bytes-cast = "0.2" |
|
14 | 14 | byteorder = "1.3.4" |
|
15 | 15 | derive_more = "0.99" |
|
16 | hashbrown = {version = "0.9.1", features = ["rayon"]} | |
|
16 | 17 | home = "0.5" |
|
17 | 18 | im-rc = "15.0.*" |
|
18 | 19 | itertools = "0.9" |
@@ -22,7 +22,7 b' use crate::DirstateError;' | |||
|
22 | 22 | use crate::DirstateParents; |
|
23 | 23 | use crate::DirstateStatus; |
|
24 | 24 | use crate::EntryState; |
|
25 | use crate::FastHashMap; | |
|
25 | use crate::FastHashbrownMap as FastHashMap; | |
|
26 | 26 | use crate::PatternFileWarning; |
|
27 | 27 | use crate::StatusError; |
|
28 | 28 | use crate::StatusOptions; |
@@ -585,13 +585,11 b" impl<'on_disk> DirstateMap<'on_disk> {" | |||
|
585 | 585 | .next() |
|
586 | 586 | .expect("expected at least one inclusive ancestor"); |
|
587 | 587 | loop { |
|
588 | // TODO: can we avoid allocating an owned key in cases where the | |
|
589 | // map already contains that key, without introducing double | |
|
590 | // lookup? | |
|
591 | let child_node = child_nodes | |
|
588 | let (_, child_node) = child_nodes | |
|
592 | 589 | .make_mut(on_disk, unreachable_bytes)? |
|
593 |
.entry( |
|
|
594 | .or_default(); | |
|
590 | .raw_entry_mut() | |
|
591 | .from_key(ancestor_path.base_name()) | |
|
592 | .or_insert_with(|| (to_cow(ancestor_path), Node::default())); | |
|
595 | 593 | if let Some(next) = inclusive_ancestor_paths.next() { |
|
596 | 594 | each_ancestor(child_node); |
|
597 | 595 | ancestor_path = next; |
@@ -56,6 +56,11 b' pub type LineNumber = usize;' | |||
|
56 | 56 | /// write access to your repository, you have other issues. |
|
57 | 57 | pub type FastHashMap<K, V> = HashMap<K, V, RandomXxHashBuilder64>; |
|
58 | 58 | |
|
59 | // TODO: should this be the default `FastHashMap` for all of hg-core, not just | |
|
60 | // dirstate_tree? How does XxHash compare with AHash, hashbrown’s default? | |
|
61 | pub type FastHashbrownMap<K, V> = | |
|
62 | hashbrown::HashMap<K, V, RandomXxHashBuilder64>; | |
|
63 | ||
|
59 | 64 | #[derive(Debug, PartialEq)] |
|
60 | 65 | pub enum DirstateMapError { |
|
61 | 66 | PathNotFound(HgPathBuf), |
General Comments 0
You need to be logged in to leave comments.
Login now