Preallocate hash tables when the number of inserts are known in advance
commitc73592812d36ccc7eccfd0489177970d246fa522
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Sun, 17 Mar 2013 03:28:06 +0000 (17 10:28 +0700)
committerJunio C Hamano <gitster@pobox.com>
Sun, 17 Mar 2013 05:57:29 +0000 (16 22:57 -0700)
tree1e92b0c8fb8cb4bf5bbb10f38cf695785457b2e7
parent03a0fb0ccf48c831060c2243f830b6a12cd8fdf3
Preallocate hash tables when the number of inserts are known in advance

This avoids unnecessary re-allocations and reinsertions. On webkit.git
(i.e. about 182k inserts to the name hash table), this reduces about
100ms out of 3s user time.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diffcore-rename.c
hash.h
name-hash.c