Mercurial > public > mercurial-scm > hg
annotate rust/hg-core/src/operations/mod.rs @ 52280:f4aede0f01af
rust-manifest: use `memchr` crate for all byte-finding needs
While writing a very dumb manifest diffing algorithm for a proof-of-concept
I saw that `Manifest::find_by_path` was much slower than I was expecting.
It turns out that the Rust stdlib uses slow (all is relative) code when
searching for byte positions for reasons ranging from portability, SIMD
API stability, nobody doing the work, etc. `memch` is much faster for these
purposes, so let's use it.
I was measuring ~670ms of profile time in `find_by_path`, after this patch
it went down to ~230ms.
author | Rapha?l Gom?s <rgomes@octobus.net> |
---|---|
date | Tue, 12 Nov 2024 23:20:04 +0100 |
parents | 7c105b953ca4 |
children | bde718849153 |
rev | line source |
---|---|
45358
452ece5654c5
hg-core: remove the `Operation` trait
Antoine Cezar <antoine.cezar@octobus.net>
parents:
45113
diff
changeset
|
1 //! A distinction is made between operations and commands. |
452ece5654c5
hg-core: remove the `Operation` trait
Antoine Cezar <antoine.cezar@octobus.net>
parents:
45113
diff
changeset
|
2 //! An operation is what can be done whereas a command is what is exposed by |
452ece5654c5
hg-core: remove the `Operation` trait
Antoine Cezar <antoine.cezar@octobus.net>
parents:
45113
diff
changeset
|
3 //! the cli. A single command can use several operations to achieve its goal. |
452ece5654c5
hg-core: remove the `Operation` trait
Antoine Cezar <antoine.cezar@octobus.net>
parents:
45113
diff
changeset
|
4 |
45541
522ec3dc44b9
hg-core: add a `CatRev` operation
Antoine Cezar <antoine.cezar@octobus.net>
parents:
45536
diff
changeset
|
5 mod cat; |
45527
b56df13a0450
hg-core: define a `DebugData` `Operation`
Antoine Cezar <antoine.cezar@octobus.net>
parents:
45359
diff
changeset
|
6 mod debugdata; |
45359
0f5286ccf82c
hg-core: define a `ListTrackedFiles` `Operation`
Antoine Cezar <antoine.cezar@octobus.net>
parents:
45358
diff
changeset
|
7 mod list_tracked_files; |
51152
ac3859a8b796
rhg: support rhg status --rev --rev
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
49980
diff
changeset
|
8 mod status_rev_rev; |
46744
b1f2c2b336ec
rhg: `cat` command: print error messages for missing files
Simon Sapin <simon.sapin@octobus.net>
parents:
46446
diff
changeset
|
9 pub use cat::{cat, CatOutput}; |
51863
69b804c8e09e
rust: use new revlog configs in all revlog opening code
Rapha?l Gom?s <rgomes@octobus.net>
parents:
51152
diff
changeset
|
10 pub use debugdata::debug_data; |
52036
7c105b953ca4
rust-files: separate the listing of files from a revset and a revision
Rapha?l Gom?s <rgomes@octobus.net>
parents:
51863
diff
changeset
|
11 pub use list_tracked_files::{ |
7c105b953ca4
rust-files: separate the listing of files from a revset and a revision
Rapha?l Gom?s <rgomes@octobus.net>
parents:
51863
diff
changeset
|
12 list_rev_tracked_files, list_revset_tracked_files, ExpandedManifestEntry, |
7c105b953ca4
rust-files: separate the listing of files from a revset and a revision
Rapha?l Gom?s <rgomes@octobus.net>
parents:
51863
diff
changeset
|
13 FilesForRev, |
7c105b953ca4
rust-files: separate the listing of files from a revset and a revision
Rapha?l Gom?s <rgomes@octobus.net>
parents:
51863
diff
changeset
|
14 }; |
51152
ac3859a8b796
rhg: support rhg status --rev --rev
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
49980
diff
changeset
|
15 pub use status_rev_rev::{status_rev_rev_no_copies, DiffStatus, StatusRevRev}; |