Skip to content
  • Jeff King's avatar
    xdiff: drop XDL_FAST_HASH · 1f7c9261
    Jeff King authored and Junio C Hamano's avatar Junio C Hamano committed
    The xdiff code hashes every line of both sides of a diff,
    and then compares those hashes to find duplicates. The
    overall performance depends both on how fast we can compute
    the hashes, but also on how many hash collisions we see.
    
    The idea of XDL_FAST_HASH is to speed up the hash
    computation. But the generated hashes have worse collision
    behavior. This means that in some cases it speeds diffs up
    (running "git log -p" on git.git improves by ~8% with it),
    but in others it can slow things down. One pathological case
    saw over a 100x slowdown[1].
    
    There may be a better hash function that covers both
    properties, but in the meantime we are better off with the
    original hash. It's slightly slower in the common case, but
    it has fewer surprising pathological cases.
    
    [1] http://public-inbox.org/git/20141222041944.GA441@peff.net/
    
    
    
    Signed-off-by: default avatarJeff King <peff@peff.net>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    1f7c9261