Subject: Re: [PATCH 0/2] optimize string hashing in xdiff

From: Junio C Hamano <[email-masked]>
Date: Mon, 28 Jul 2025 12:32:11 -0700

Alexander Monakov <[email-masked]> writes:

> I've noticed the work by Phillip Wood regarding hash optimization for xdiff.
> I want to point out that it is possible to speed up the existing hash by 1.5x
> matching the peformance of xxhash (but without introducing a dependendency).

Using xxhash() was merely a sample code path for technology
demonstration, so the Rust adoption topic may want to pick a
different code path to do its thing.

> The additive variant of the djb2 hash is used in ELF symbol lookup, and
> Noah Goldstein contributed a well-optimized implementation to Glibc.

What is the licensing terms for that code you are proposing us to
borrow?  If it is anything recent in GNU, I'd expect that it would
be GPLv3, which would be incompatible with our code base?

> I'm taking the refactoring patch from Phillip and building on top of it.

It is an obviously good approach to do this.