Commit c0dcc45
perf(hash): replace twox-hash with xxhash-rust and optimize file hashing
- Replace `twox-hash` (XxHash64 via Hasher trait) with `xxhash-rust`'s
direct `xxh64()` function call. The xxhash-rust crate has a more
optimized implementation and the direct function avoids Hasher trait
overhead. Same algorithm, same output, no cache invalidation.
- Pre-allocate read buffer in `git_like_hash_file` based on file
metadata size, eliminating repeated Vec reallocations during
`read_to_end` for every file hashed.
- Add criterion benchmarks for both turborepo-hash (task/global/file
hash computation) and turborepo-scm (file content hashing at various
sizes).
https://claude.ai/code/session_01JTwyUFFEGSJK1RUxGfBx8K1 parent 3970226 commit c0dcc45
File tree
4 files changed
+14
-19
lines changed- crates
- turborepo-hash
- src
- turborepo-scm/src
4 files changed
+14
-19
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | 1 | | |
4 | 2 | | |
5 | 3 | | |
| |||
31 | 29 | | |
32 | 30 | | |
33 | 31 | | |
34 | | - | |
35 | | - | |
36 | | - | |
| 32 | + | |
37 | 33 | | |
38 | 34 | | |
39 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
19 | 23 | | |
20 | 24 | | |
21 | 25 | | |
| |||
0 commit comments