diff options
author | Nicolas Pitre <nico@fluxnic.net> | 2013-09-10 18:17:12 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-09-11 12:25:33 -0700 |
commit | 9f36c9b7f77f188db47b80ae1118856249beaa15 (patch) | |
tree | fc85141e788ce1e2c989d155f205e29451916624 /Documentation | |
parent | Git 1.8.4 (diff) | |
download | tgif-9f36c9b7f77f188db47b80ae1118856249beaa15.tar.xz |
lookup_object: remove hashtable_index() and optimize hash_obj()
hashtable_index() appears to be a close duplicate of hash_obj().
Keep only the later and make it usable for all cases.
Also remove the modulus as this is an expensive operation.
The size argument is always a power of 2 anyway, so a simple
mask operation provides the same result.
On a 'git rev-list --all --objects' run this decreased the time spent
in lookup_object from 27.5% to 24.1%.
[jc: with a few comments on "modulus turned into mask" by Peff]
Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation')
0 files changed, 0 insertions, 0 deletions