ok/jj
1
0
Fork 0
forked from mirrors/jj
jj/lib
Samuel Tardieu 56dbbb8fc6 lib: optimize common prefix computation of two hex strings
Comparing each byte before comparing the nibbles is more efficient. A
benchmark comparing the old and new implementations with various common
prefix lengths shows:

```
Common hex len/old/3    time:   [7.5444 ns 7.5807 ns 7.6140 ns]
Common hex len/new/3    time:   [1.2100 ns 1.2144 ns 1.2192 ns]
Common hex len/old/6    time:   [11.849 ns 11.879 ns 11.910 ns]
Common hex len/new/6    time:   [1.9950 ns 2.0046 ns 2.0156 ns]
Common hex len/old/32   time:   [63.030 ns 63.345 ns 63.718 ns]
Common hex len/new/32   time:   [6.4647 ns 6.4800 ns 6.4999 ns]
```
2024-09-15 18:32:28 +02:00
..
benches formatting only: switch to Item level import ganularity 2024-08-22 14:52:54 -04:00
gen-protos Use { workspace = true } to appease VS Code's Cargo.toml parser 2023-08-22 21:38:53 -07:00
proc-macros formatting only: switch to Item level import ganularity 2024-08-22 14:52:54 -04:00
src lib: optimize common prefix computation of two hex strings 2024-09-15 18:32:28 +02:00
tests id_prefix: fix crash on hidden change id disambiguation 2024-09-13 19:32:53 +09:00
testutils tests: remove temporary copy of workspace.repo_path() from TestWorkspace 2024-09-08 05:40:52 +09:00
Cargo.toml cargo: add "clru" dependency 2024-08-29 23:33:37 +09:00
LICENSE cargo: add LICENSE file to each crate we publish 2023-09-22 21:48:28 -07:00