Commit 663c5ad
diff histogram: intern strings
Histogram is the only diff algorithm not to call
xdl_classify_record(). xdl_classify_record() ensures that the hash
values of two strings that are not equal differ which means that it is
not necessary to use xdl_recmatch() when comparing lines, all that is
necessary is to compare the hash values. This gives a 7% reduction in
the runtime of "git log --patch" when using the histogram diff
algorithm.
Test HEAD^ HEAD
-----------------------------------------------------------------------------
4000.1: log -3000 (baseline) 0.18(0.14+0.04) 0.19(0.17+0.02) +5.6%
4000.2: log --raw -3000 (tree-only) 0.99(0.77+0.21) 0.98(0.78+0.20) -1.0%
4000.3: log -p -3000 (Myers) 4.84(4.31+0.51) 4.81(4.15+0.64) -0.6%
4000.4: log -p -3000 --histogram 6.34(5.86+0.46) 5.87(5.19+0.66) -7.4%
4000.5: log -p -3000 --patience 5.39(4.60+0.76) 5.35(4.60+0.73) -0.7%
Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent cd3e606 commit 663c5ad
2 files changed
+10
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
95 | | - | |
96 | | - | |
| 94 | + | |
| 95 | + | |
97 | 96 | | |
98 | 97 | | |
99 | 98 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
193 | 189 | | |
194 | 190 | | |
195 | 191 | | |
| |||
208 | 204 | | |
209 | 205 | | |
210 | 206 | | |
211 | | - | |
212 | | - | |
213 | | - | |
| 207 | + | |
214 | 208 | | |
215 | 209 | | |
216 | 210 | | |
| |||
279 | 273 | | |
280 | 274 | | |
281 | 275 | | |
282 | | - | |
283 | | - | |
| 276 | + | |
284 | 277 | | |
285 | 278 | | |
286 | 279 | | |
| |||
305 | 298 | | |
306 | 299 | | |
307 | 300 | | |
308 | | - | |
309 | | - | |
| 301 | + | |
310 | 302 | | |
311 | 303 | | |
312 | 304 | | |
| |||
0 commit comments