-
Notifications
You must be signed in to change notification settings - Fork 251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prime benchmark radix tries use hash maps #364
Comments
Agreed, but if we change one implementation, the similar changes should be implemented for all other tests. Also please note that we don't have a goal to create the fastest prime numbers generator, but rather to compare performance of the similar functionality between different languages. It's quite tough and unfair task already, and micro-optimizations could make it even more tougher and more unfair. For example, PHP arrays are internally all hashmaps regardless of how they used (as vectors or as associative arrays), so the change like that won't affect its performance. Nevertheless, I'd accept the PR with changes (if all tests are addressed). |
Each node in the radix tries should have at most 10 children. In this scenario, a hash map often adds overhead compared to using a simple 10-element array. For example, i was able to reduce the runtime of the Zig implementation from 67 to 42 ms on my machine, and i suspect similar improvements are possible for the other compiled languages.
The text was updated successfully, but these errors were encountered: