Re: [PATCH 0/7] pack-objects: Create an alternative name hash algorithm (recreated)
- From
- Jonathan Tan <jonathantanmy@google.com>
- Date
- Nov 22, 2024, 18:05 UTC
- Message-ID
- <20241122180530.530499-1-jonathantanmy@google.com>
- In-Reply-To
- <xmqqiksgas54.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 7 quoted lines
> I wonder if we do even better if we reverse all 8 bits instead of > swapping nybbles (if we were to do so, it might be more efficient to > shift in from the right instead of left end of the base and hash > accumulators in the loop and then swap the whole resulting word at > the end). > > Thanks for a fun read.
Ah, yes, reversing is better than swapping nybbles (the least significant 2 bits have more entropy than the next-least significant 2 bits). When writing this, I didn't think of shifting in from the right (if I had thought of that, I would have indeed reversed the bits instead).