Commit 1a92ad2
Remove kstring from gix-attributes.
Add Criterion benchmarks for attribute lookup in a single file with 1, 10, 100, and 1000 entries, plus five nested files with 1024, 512, 256, 128, and 64 entries.
The kstring baseline measured 58.393 ns, 670.48 ns, 8.0138 us, and 96.207 us for the single-file cases, and 209.72 us for the hierarchy. Store owned attribute names in gix-features OwnShared<str>, using Rc without the parallel feature and Arc with it, so lookup clones remain allocation-free without another string dependency or leaked storage. Default-mode medians are 55.115 ns, 643.63 ns, 7.9572 us, 95.431 us, and 207.61 us; parallel-mode medians are 57.324 ns, 668.03 ns, 7.8143 us, 94.853 us, and 204.28 us. Outcome shrinks from 840 to 752 bytes.
Keep non-parallel consumers Rc-compatible: own the synthetic match-all pathspec per Search, defer CLI pathspec construction until after the worker boundary, transport attribute baseline assignments as thread-safe strings, and cache test exclusions per thread for the repository discovered from each archive path. Forward the parallel opt-in through public dependent crates, with Send assertions for pathspec Search and filter Pipeline. The always-threaded worktree stream enables parallel explicitly.
Validation:
- just check
- cargo +1.85.0 test -p gix-attributes --lib --tests
- cargo +1.85.0 test -p gix-attributes --lib --tests --features parallel
- cargo test -p gix-attributes
- cargo test -p gix-attributes --all-features --lib --tests
- cargo test -p gix-pathspec --features parallel
- cargo test -p gix-filter --features sha1,parallel
- cargo test -p gix-testtools --lib --tests
- cargo test -p gitoxide-core --lib
- cargo test --no-default-features --features small --lib
- cargo clippy -p gix-attributes --all-targets --all-features -- -D warnings
- cargo clippy -p gix-pathspec --all-targets --features parallel -- -D warnings
- cargo clippy -p gix-filter --all-targets --features sha1,parallel -- -D warnings
- cargo clippy --no-default-features --features small -- -D warnings
- cargo check --workspace --all-targets
- cargo build -p gix-pathspec --target wasm32-wasip1
- cargo build -p gix-pathspec --target wasm32-wasip2
- cargo build -p gix-pathspec --target wasm32-unknown-unknown
- cargo bench -p gix-attributes --bench lookup -- --noplot
- cargo bench -p gix-attributes --bench lookup --features parallel -- --noplot1 parent 299d16b commit 1a92ad2
28 files changed
Lines changed: 460 additions & 178 deletions
File tree
- gitoxide-core/src/repository/attributes
- gix-attributes
- benches
- src
- search
- tests/attributes
- gix-filter
- tests/filter
- gix-pathspec
- src
- search
- tests
- gix-worktree-stream
- gix-worktree
- gix
- src
- porcelain
- tests
- it/src
- tools
- src
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 42 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
22 | 26 | | |
23 | 27 | | |
24 | 28 | | |
| |||
200 | 204 | | |
201 | 205 | | |
202 | 206 | | |
203 | | - | |
| 207 | + | |
204 | 208 | | |
205 | 209 | | |
206 | 210 | | |
207 | | - | |
| 211 | + | |
208 | 212 | | |
209 | 213 | | |
210 | 214 | | |
211 | 215 | | |
212 | 216 | | |
213 | 217 | | |
214 | 218 | | |
215 | | - | |
| 219 | + | |
216 | 220 | | |
217 | 221 | | |
218 | 222 | | |
| |||
256 | 260 | | |
257 | 261 | | |
258 | 262 | | |
259 | | - | |
| 263 | + | |
260 | 264 | | |
261 | 265 | | |
262 | 266 | | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
263 | 293 | | |
264 | 294 | | |
265 | 295 | | |
| |||
329 | 359 | | |
330 | 360 | | |
331 | 361 | | |
332 | | - | |
| 362 | + | |
333 | 363 | | |
334 | 364 | | |
335 | 365 | | |
| |||
339 | 369 | | |
340 | 370 | | |
341 | 371 | | |
342 | | - | |
| 372 | + | |
343 | 373 | | |
344 | 374 | | |
345 | 375 | | |
346 | 376 | | |
347 | 377 | | |
348 | 378 | | |
349 | | - | |
350 | | - | |
| 379 | + | |
| 380 | + | |
351 | 381 | | |
352 | 382 | | |
353 | 383 | | |
| |||
364 | 394 | | |
365 | 395 | | |
366 | 396 | | |
367 | | - | |
368 | | - | |
369 | | - | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
370 | 400 | | |
371 | 401 | | |
372 | 402 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
17 | 22 | | |
18 | 23 | | |
19 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
20 | 27 | | |
21 | 28 | | |
| 29 | + | |
22 | 30 | | |
23 | 31 | | |
24 | 32 | | |
25 | 33 | | |
26 | 34 | | |
27 | 35 | | |
28 | 36 | | |
29 | | - | |
30 | 37 | | |
31 | 38 | | |
32 | 39 | | |
33 | 40 | | |
34 | 41 | | |
35 | 42 | | |
36 | 43 | | |
37 | | - | |
| 44 | + | |
| 45 | + | |
38 | 46 | | |
39 | 47 | | |
40 | 48 | | |
| |||
0 commit comments