Thread (7 messages) flat view 7 messages, 3 authors, 2016-06-15

Re: [PATCH] parse_object: try internal cache before reading object db

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:52:43

Possibly related (same subject, not in this thread)

Jeff King [off-list ref] writes:
This might seem circular, since step 2a uses the type
information determined in step 1 to call the appropriate
lookup function. However, we can notice that all of the
lookup_* functions are backed by lookup_object. In other
words, all of the objects are kept in a master hash table,
and we don't actually need the type to do the "do we have
it" part of the lookup,...
The only case that might matter is where you read one object, you have
written another object of a different type but that happens to hash to the
same SHA-1 value. The other existing optimizations do not take that into
account, so I do not think there is any new issue here.
For example, GitHub's alternates repository for git.git has
~120,000 refs, of which only ~3200 are unique. The time for
upload-pack to print its list of advertised refs dropped
from 3.4s to 0.76s.
Nice. I am more impressed by 120k/3.4 than 3.2k/0.76, though ;-)

Thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help