Speed up git notes lookup
commit2dd625d022074bb677bdd5caa5146cabaf726123
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>
Sat, 20 Dec 2008 12:05:47 +0000 (20 13:05 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 12 Jan 2009 03:17:45 +0000 (11 19:17 -0800)
treefabcf925aed516dc9054d9b9050f13188d084f74
parent055a5975258f37eecdfcf609a472ab4957a59263
Speed up git notes lookup

To avoid looking up each and every commit in the notes ref's tree
object, which is very expensive, speed things up by slurping the tree
object's contents into a hash_map.

The idea fo the hashmap singleton is from David Reiss, initial
benchmarking by Jeff King.

Note: the implementation allows for arbitrary entries in the notes
tree object, ignoring those that do not reference a valid object.  This
allows you to annotate arbitrary branches, or objects.

[jc: fixed an obvious error in initialize_hash_map()]

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
notes.c