Commit 98e2092
cat-file: teach --batch to stream blob objects
The regular "git cat-file -p" and "git cat-file blob" code
paths already learned to stream large blobs. Let's do the
same here.
Note that this means we look up the type and size before
making a decision of whether to load the object into memory
or stream (just like the "-p" code path does). That can lead
to extra work, but it should be dwarfed by the cost of
actually accessing the object itself. In my measurements,
there was a 1-2% slowdown when using "--batch" on a large
number of objects.
Signed-off-by: Jeff King <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>1 parent 03c893c commit 98e2092
1 file changed
+28
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
120 | 145 | | |
121 | 146 | | |
122 | 147 | | |
123 | 148 | | |
124 | 149 | | |
125 | | - | |
126 | 150 | | |
127 | 151 | | |
128 | 152 | | |
| |||
133 | 157 | | |
134 | 158 | | |
135 | 159 | | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
| 160 | + | |
141 | 161 | | |
142 | 162 | | |
143 | 163 | | |
144 | | - | |
145 | | - | |
146 | 164 | | |
147 | 165 | | |
148 | 166 | | |
149 | 167 | | |
150 | 168 | | |
151 | 169 | | |
152 | 170 | | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
| 171 | + | |
| 172 | + | |
157 | 173 | | |
158 | | - | |
159 | 174 | | |
160 | 175 | | |
161 | 176 | | |
| |||
0 commit comments