libgit2/libgit2 — pull request #2335 by carlosmn (2014-05-08 20:41:28+00:00)
Title: indexer: avoid memory moves

Our vector does a move of the rest of the array when we remove an
item. Doing this repeatedly can be expensive, and we do this a lot in
the indexer. Instead, set the value to NULL and skip those entries.

perf reported around 30% of `index-pack` time was going into
memmove. With this change, that goes away and we spent most of the time
hashing and inflating data.

---

After some time trying different things trying to be smart, with this one weird trick, we drop down from 15s back to 8s and parity with a single-threaded git. This changes got introduced for thin packs and then I guess I never bothered to look at performance again.