Skip to content

Conversation

MaxGraey
Copy link
Member

@MaxGraey MaxGraey commented Dec 14, 2020

XXHash32 has better quality and speed (especially for 32-bit, 64-bit and >= 16 bytes keys).

FNV-1a:

  • Poor uniform distribution. Only up to 14 bits can be used for the hash table (up to 2 ^ 14 hash table slots) without degradation
  • Bad avalanche effect
  • Speed: 4.5 cyclers per byte

XXHash:

  • Excellent uniform distribution
  • Near-perfect avalanche effect
  • Speed: ~1.7 cyclers per byte

string perf tests

u64 hash tests

old u64 hash (fnv-1a): 281.68000001460314 ms
new u64 hash (xxhash): 189.05499996617436 ms
  • I've read the contributing guidelines

@MaxGraey MaxGraey mentioned this pull request Dec 14, 2020
1 task
@dcodeIO dcodeIO merged commit 6905299 into AssemblyScript:master Feb 7, 2021
@MaxGraey MaxGraey deleted the xxhash branch February 7, 2021 03:00
@dcodeIO
Copy link
Member

dcodeIO commented Feb 7, 2021

🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants