Now the symptoms are demonstrated. The new hashing is not better than the older one, it is even *worse*.
Can you share some Lua code that we can benchmark, and which causes the worst case you mention?
We can use random strings to set the baseline, then use carefully crafted strings to cause the worst case.
Once we make it reproducible we can measure the impact of changes to the hash function.
Andrea