This repository was archived by the owner on Sep 11, 2020. It is now read-only.
Commit 939793b
committed
git: remote, Do not iterate all references on update.
The current code iterates all the references in the remote to check if
they match the refspec. This is OK when the refspec is a wildcard but
is a waste of time when they are not.
A hash with references is generated for fast access before starting the
update and used only when the refspec is not a wildcard.
In a repository with 7800 references this meant 7800 * 7800 checks. With
the current code it took 8m30s to update the references. With the new
code it takes less than 0.5s.
References are already extensively tested in remote_test.go.
Signed-off-by: Javi Fontan <[email protected]>1 parent e63b032 commit 939793b
1 file changed
+22
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
371 | 371 | | |
372 | 372 | | |
373 | 373 | | |
374 | | - | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
375 | 382 | | |
376 | 383 | | |
377 | 384 | | |
378 | 385 | | |
379 | 386 | | |
380 | 387 | | |
381 | | - | |
| 388 | + | |
| 389 | + | |
382 | 390 | | |
383 | 391 | | |
384 | 392 | | |
| |||
390 | 398 | | |
391 | 399 | | |
392 | 400 | | |
| 401 | + | |
393 | 402 | | |
394 | 403 | | |
395 | 404 | | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
396 | 416 | | |
397 | 417 | | |
398 | 418 | | |
| |||
0 commit comments