Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/matiaskorhonen/digest_bench
Benchmarks of various hash algorithms
https://github.com/matiaskorhonen/digest_bench
benchmarks hashing ruby
Last synced: 28 days ago
JSON representation
Benchmarks of various hash algorithms
- Host: GitHub
- URL: https://github.com/matiaskorhonen/digest_bench
- Owner: matiaskorhonen
- License: mit
- Created: 2024-03-06T20:25:22.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-03-13T16:44:30.000Z (10 months ago)
- Last Synced: 2024-10-14T21:15:15.860Z (2 months ago)
- Topics: benchmarks, hashing, ruby
- Language: Ruby
- Homepage: https://www.randomerrata.com/articles/2024/hashing-benchmarks/
- Size: 10.7 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Non-scientific hash benchmarks
Benchmarks of various hash algorithms with Ruby.
## Algorithms
* Ruby stdlib:
* [MD5][]
* [SHA1][]/[SHA256][SHA2]/[SHA512][SHA2]
* [Zlib CRC32][]
* Gems:
* [digest-xxhash][] (XXH32/XXH64/XXH3)
* [murmurhash3][] (32/128)
* [cityhash][] (32/64/128)
* [openssl][] (MD5, SHA1, SHA256, SHA512, SHA3)These algorithms are not all equivalent so don't just blindly pick the fastest one!
[MD5]: https://docs.ruby-lang.org/en/3.3/Digest/MD5.html
[SHA1]: https://docs.ruby-lang.org/en/3.3/Digest/SHA1.html
[SHA2]: https://docs.ruby-lang.org/en/3.3/Digest/SHA2.html
[SHA1]: https://docs.ruby-lang.org/en/3.3/Digest/SHA1.html
[Zlib CRC32]: https://docs.ruby-lang.org/en/3.3/Zlib.html#method-c-crc32
[digest-xxhash]: https://rubygems.org/gems/digest-xxhash
[murmurhash3]: https://rubygems.org/gems/murmurhash3
[cityhash]: https://rubygems.org/gems/cityhash
[openssl]: https://rubygems.org/gems/openssl## More info
See the [accompanying blog post](https://www.randomerrata.com/articles/2024/hashing-benchmarks/) for a chart and some more details.