]> git.ipfire.org Git - thirdparty/make.git/commit
Use Jenkins hash.
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 11 Aug 2017 11:44:28 +0000 (13:44 +0200)
committerPaul Smith <psmith@gnu.org>
Sat, 11 Nov 2017 15:08:30 +0000 (10:08 -0500)
commit4fd56724ad281498d3c8b27a4b25b4070f6e4e65
tree14437efe53e1532d12e08563625e115204804b55
parent0ca31088dc1b7e2d737d5908237e6042f3b42108
Use Jenkins hash.

This is about twice as fast as the current hash, and removes the
need for double hashing (improving locality of reference).  The
hash function is based on Bob Jenkins' design, slightly adapted
wherever Make needs to hash NUL-terminated strings.  The old hash
function is kept for case-insensitive hashing.

This saves 8.5% on QEMU's no-op build (from 12.87s to 11.78s).

* configure.ac: Check endianness.
* hash.c (rol32, jhash_mix, jhash_final, JHASH_INITVAL,
sum_get_unaligned_32, jhash): New.
* hash.h (STRING_HASH_1, STRING_N_HASH_1): Use jhash.
(STRING_HASH_2, STRING_N_HASH_2): Return a dummy value.
(STRING_N_COMPARE, return_STRING_N_COMPARE): Prefer memcmp to strncmp.
config.h-vms.template
config.h.W32.template
configure.ac
hash.c
hash.h
tests/scripts/targets/INTERMEDIATE
tests/scripts/targets/SECONDARY