-
Notifications
You must be signed in to change notification settings - Fork 207
Long2ObjectOpenHashMap is slower than HashMap in java.util #347
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
Comments
a) this isn't really a good benchmark, you'd need to use JMH's blackhole or similar for to disallow the compiler from proving that map.get(...) is side-effect free.
Here, java's map is approx. factor 1.5-2 slower on my machine. (If you need to store "continuous" blocks, try https://github.com/incaseoftrouble/naturals-util ;) ) (Instead of using Random, you could also use, e.g. |
@incaseoftrouble Thanks for your quick reply, which gives me confidence in using this tool. I will change my test code and try again. |
@incaseoftrouble Yes, you are right, I change the key to
A great tool to save to memory footprint. |
Uh oh!
There was an error while loading. Please reload this page.
This is my test code:
The result is
jdk version is:
The text was updated successfully, but these errors were encountered: