wyhash
countwords
Our great sponsors
wyhash | countwords | |
---|---|---|
9 | 43 | |
913 | 209 | |
- | - | |
6.6 | 5.9 | |
3 months ago | about 2 years ago | |
C | Rust | |
The Unlicense | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
wyhash
- Wyhash: The fastest quality hash function
-
What hash function you use for hash maps / hash tables?
I recently switched to wyhash as it seems to have a good combination of speed and stability.
-
Are there any weaker hashes than MD5, but still randomly distributed?
wyhash is a decent option for if you don't need a cryptographical quality hash
-
Hacker News top posts: Mar 15, 2021
New Bare Hash Map: 2X-3X Speedup over SOTA\ (32 comments)
-
New Bare Hash Map: 2X-3X Speedup over SOTA
I feel like you’d want something a bit safer than “we don’t store the keys and just rely on the hash to be really good” [1], putting “please do not use this for serious tasks” in a comment embedded in the header file isn’t a clear enough warning.
It’s not clear to me that that probability of collision assumptions hold. It’s basically assuming that the hashing is perfect and distributes any inputs to the full 64-bit space with uniform probability. That’s the usual hash map / randomized algorithm hope, but does BigCrush or similar avalanche testing really prove that? (Presumably not, otherwise there wouldn’t be image attacks for things like md5).
[1] https://github.com/wangyi-fudan/wyhash/blob/d2a305811972f391...
- wyhash and wyrand are a non-cryptographic 64-bit hash function and PRNG respectively
countwords
-
How fast is really ASP.NET Core?
"dang, I didn't know that was 50x faster than the idiomatic way" or "hey, I didn't know that this implementation in the stdlib prioritized this over that and made this so slow, that's interesting" -- .e.g, there's some kinda neat language details to be found in something like Ben Hoyt's community word count benchmarks repo and 'simple' vs 'optimal' code: https://github.com/benhoyt/countwords
-
Correct name for word matching problem
It benchmarks programs that count the total number of unique words in some input. It's not exactly equivalent to your problem, but it's similarish. All of the programs used some kind of hash map for lookups, but I contributed a program that used a trie. Its performance in my experience varies depending on the CPU interestingly enough. On my old CPU (i7-6900K) it was a little slower, but on my new cpu (i9-12900KS) it was faster.
-
Performance comparison: counting words in Python, C/C++, Awk, Rust, and more
Why not read the source code? :-)
I wrote comments explaining things: https://github.com/benhoyt/countwords/blob/8553c8f600c40a462...
-
do you guys prefer functional programming style when using rust?
My own code example of a drastic speed up (~25%) simply replacing a couple of for loops with iters: https://github.com/benhoyt/countwords/pull/115
- Ripen scripting engine (Similar to RetroForth, but tiny)
- Performance comparison: counting words in Python, Go, C++, C, AWK, Forth, and Rust
-
The difference between Go and Rust
And yet Go was faster than Rust in a simple app that count words: https://benhoyt.com/writings/count-words/
-
How to Rapidly Improve at Any Programming Language
> but the performance profiles & characteristics that we must know about in order to make a choice on which tool to use. And it shouldn't be that each user has to figure it out on their own, dig into PR's or whatever.
That's an interesting take – I like the idea of a catalog of standard tasks with implementations in several languages as well as their performance characteristics. I suppose Rosetta Code gets the ball rolling with this, but it's missing some performance metrics. It reminds me of [Ben Hoyt's piece](https://benhoyt.com/writings/count-words/) on counting unique words in the KJV Bible in different languages.
-
Faster string keyed maps in Go
This article shows that map lookups can be optimized by using the (unintuitive) pattern:
- Go beats out several top languages including Rust in this performance matchup
What are some alternatives?
smhasher - Hash function quality and speed tests
CPython - The Python programming language
aHash - aHash is a non-cryptographic hashing algorithm that uses the AES hardware instruction
coreutils - upstream mirror
meow_hash - Official version of the Meow hash, an extremely fast level 1 hash
llfio - P1031 low level file i/o and filesystem library for the C++ standard
leocad - A CAD application for creating virtual LEGO models
parallel-hashmap - A family of header-only, very fast and memory-friendly hashmap and btree containers.
smhasher - Automatically exported from code.google.com/p/smhasher
securitytxt.org - Static website for security.txt.
Mersenne-Twister-in-Python - A Mersenne Twister Random Number Generator