String hashing improvements (spread and performance)
Fix gaps in hashing coverage in the middle and end of even fairly short
strings. E.g., `outline-1`, `outline-2` etc all hashed to the exact
same value but with the patch, there are no collisions among the ~160000
symbols in the Emacs tree.
This change also improves average hashing speed by using fewer mixing
operations.
* src/fns.c (hash_string):
Use unit stride for fairly short strings, while retaining the cap of 8
samples for long ones.
Always hash the last word to ensure that the end of the string is
covered. For strings shorter than a word, use fewer loads and a single
reduction step.
(cherry picked from commit
3a93e301ddc913758abe05c876aa3016e8b23af8)