Commit 1a2e1a7
committed
Merge branch 'mh/mmap-packed-refs'
Operations that do not touch (majority of) packed refs have been
optimized by making accesses to packed-refs file lazy; we no longer
pre-parse everything, and an access to a single ref in the
packed-refs does not touch majority of irrelevant refs, either.
* mh/mmap-packed-refs: (21 commits)
packed-backend.c: rename a bunch of things and update comments
mmapped_ref_iterator: inline into `packed_ref_iterator`
ref_cache: remove support for storing peeled values
packed_ref_store: get rid of the `ref_cache` entirely
ref_store: implement `refs_peel_ref()` generically
packed_read_raw_ref(): read the reference from the mmapped buffer
packed_ref_iterator_begin(): iterate using `mmapped_ref_iterator`
read_packed_refs(): ensure that references are ordered when read
packed_ref_cache: keep the `packed-refs` file mmapped if possible
packed-backend.c: reorder some definitions
mmapped_ref_iterator_advance(): no peeled value for broken refs
mmapped_ref_iterator: add iterator over a packed-refs file
packed_ref_cache: remember the file-wide peeling state
read_packed_refs(): read references with minimal copying
read_packed_refs(): make parsing of the header line more robust
read_packed_refs(): only check for a header at the top of the file
read_packed_refs(): use mmap to read the `packed-refs` file
die_unterminated_line(), die_invalid_line(): new functions
packed_ref_cache: add a backlink to the associated `packed_ref_store`
prefix_ref_iterator: break when we leave the prefix
...File tree
9 files changed
+848
-369
lines changed- refs
9 files changed
+848
-369
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
208 | 211 | | |
209 | 212 | | |
210 | 213 | | |
| |||
1391 | 1394 | | |
1392 | 1395 | | |
1393 | 1396 | | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
1394 | 1400 | | |
1395 | 1401 | | |
1396 | 1402 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
| 187 | + | |
187 | 188 | | |
188 | 189 | | |
189 | 190 | | |
| |||
353 | 354 | | |
354 | 355 | | |
355 | 356 | | |
| 357 | + | |
356 | 358 | | |
357 | 359 | | |
358 | 360 | | |
| |||
501 | 503 | | |
502 | 504 | | |
503 | 505 | | |
| 506 | + | |
504 | 507 | | |
505 | 508 | | |
506 | 509 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1285 | 1285 | | |
1286 | 1286 | | |
1287 | 1287 | | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
1288 | 1292 | | |
1289 | 1293 | | |
1290 | 1294 | | |
| |||
1686 | 1690 | | |
1687 | 1691 | | |
1688 | 1692 | | |
1689 | | - | |
| 1693 | + | |
| 1694 | + | |
| 1695 | + | |
| 1696 | + | |
| 1697 | + | |
| 1698 | + | |
| 1699 | + | |
| 1700 | + | |
| 1701 | + | |
| 1702 | + | |
| 1703 | + | |
| 1704 | + | |
| 1705 | + | |
| 1706 | + | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
1690 | 1710 | | |
1691 | 1711 | | |
1692 | 1712 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
641 | 641 | | |
642 | 642 | | |
643 | 643 | | |
644 | | - | |
645 | | - | |
646 | | - | |
647 | | - | |
648 | | - | |
649 | | - | |
650 | | - | |
651 | | - | |
652 | | - | |
653 | | - | |
654 | | - | |
655 | | - | |
656 | | - | |
657 | | - | |
658 | | - | |
659 | | - | |
660 | | - | |
661 | | - | |
662 | | - | |
663 | | - | |
664 | | - | |
665 | | - | |
666 | | - | |
667 | | - | |
668 | | - | |
669 | | - | |
670 | | - | |
671 | | - | |
672 | | - | |
673 | | - | |
674 | | - | |
675 | | - | |
676 | | - | |
677 | | - | |
678 | | - | |
679 | | - | |
680 | | - | |
681 | 644 | | |
682 | 645 | | |
683 | 646 | | |
| |||
748 | 711 | | |
749 | 712 | | |
750 | 713 | | |
751 | | - | |
| 714 | + | |
752 | 715 | | |
753 | 716 | | |
754 | 717 | | |
| |||
758 | 721 | | |
759 | 722 | | |
760 | 723 | | |
761 | | - | |
762 | | - | |
763 | | - | |
764 | | - | |
765 | 724 | | |
766 | 725 | | |
767 | 726 | | |
| |||
797 | 756 | | |
798 | 757 | | |
799 | 758 | | |
800 | | - | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
801 | 766 | | |
802 | 767 | | |
803 | 768 | | |
| |||
2094 | 2059 | | |
2095 | 2060 | | |
2096 | 2061 | | |
2097 | | - | |
| 2062 | + | |
2098 | 2063 | | |
2099 | 2064 | | |
2100 | 2065 | | |
| |||
2138 | 2103 | | |
2139 | 2104 | | |
2140 | 2105 | | |
| 2106 | + | |
2141 | 2107 | | |
2142 | 2108 | | |
2143 | 2109 | | |
| |||
3089 | 3055 | | |
3090 | 3056 | | |
3091 | 3057 | | |
3092 | | - | |
3093 | 3058 | | |
3094 | 3059 | | |
3095 | 3060 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
| 32 | + | |
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
| |||
72 | 74 | | |
73 | 75 | | |
74 | 76 | | |
75 | | - | |
| 77 | + | |
76 | 78 | | |
77 | 79 | | |
78 | 80 | | |
| |||
205 | 207 | | |
206 | 208 | | |
207 | 209 | | |
| 210 | + | |
208 | 211 | | |
209 | 212 | | |
210 | 213 | | |
| |||
219 | 222 | | |
220 | 223 | | |
221 | 224 | | |
222 | | - | |
| 225 | + | |
223 | 226 | | |
224 | 227 | | |
225 | 228 | | |
| |||
268 | 271 | | |
269 | 272 | | |
270 | 273 | | |
| 274 | + | |
| 275 | + | |
271 | 276 | | |
272 | 277 | | |
273 | | - | |
| 278 | + | |
274 | 279 | | |
275 | 280 | | |
276 | 281 | | |
| |||
282 | 287 | | |
283 | 288 | | |
284 | 289 | | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
285 | 304 | | |
286 | 305 | | |
287 | 306 | | |
288 | 307 | | |
289 | 308 | | |
290 | 309 | | |
291 | 310 | | |
292 | | - | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
293 | 314 | | |
294 | 315 | | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
295 | 330 | | |
296 | 331 | | |
297 | 332 | | |
| |||
361 | 396 | | |
362 | 397 | | |
363 | 398 | | |
364 | | - | |
| 399 | + | |
365 | 400 | | |
366 | 401 | | |
367 | 402 | | |
| |||
0 commit comments