Commit cfa2e29
committed
packed_ref_store: get rid of the
Now that everything has been changed to read what it needs directly
out of the `packed-refs` file, `packed_ref_store` doesn't need to
maintain a `ref_cache` at all. So get rid of it.
First of all, this will save a lot of memory and lots of little
allocations. Instead of needing to store complicated parsed data
structures in memory, we just mmap the file (potentially sharing
memory with other processes) and parse only what we need.
Moreover, since the mmapped access to the file reads only the parts of
the file that it needs, this might save reading all of the data from
disk at all (at least if the file starts out sorted).
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>ref_cache entirely1 parent b9c1f57 commit cfa2e29
1 file changed
+2
-27
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
49 | | - | |
50 | 48 | | |
51 | 49 | | |
52 | 50 | | |
| |||
148 | 146 | | |
149 | 147 | | |
150 | 148 | | |
151 | | - | |
152 | 149 | | |
153 | 150 | | |
154 | 151 | | |
| |||
719 | 716 | | |
720 | 717 | | |
721 | 718 | | |
722 | | - | |
723 | | - | |
724 | 719 | | |
725 | | - | |
726 | 720 | | |
727 | 721 | | |
728 | 722 | | |
729 | | - | |
730 | | - | |
731 | 723 | | |
732 | 724 | | |
733 | 725 | | |
| |||
800 | 792 | | |
801 | 793 | | |
802 | 794 | | |
803 | | - | |
804 | | - | |
805 | | - | |
806 | | - | |
807 | | - | |
808 | | - | |
809 | | - | |
810 | | - | |
811 | | - | |
812 | | - | |
813 | | - | |
814 | | - | |
815 | | - | |
816 | | - | |
817 | | - | |
818 | | - | |
819 | | - | |
820 | 795 | | |
821 | 796 | | |
822 | 797 | | |
| |||
975 | 950 | | |
976 | 951 | | |
977 | 952 | | |
978 | | - | |
979 | | - | |
| 953 | + | |
| 954 | + | |
980 | 955 | | |
981 | 956 | | |
982 | 957 | | |
| |||
0 commit comments