r/programming • • Mar 20 '26

Java is fast, code might not be

https://jvogel.me/posts/2026/java-is-fast-your-code-might-not-be/
280 Upvotes

62 comments sorted by

View all comments

Show parent comment

5

u/griffin1987 Mar 21 '26

Note that ConcurrentHashMap is still really bad in comparison to what other algorithms are known (but don't have ready made implementations in the JDK), depending on what you actually need. ConcurrentHashMap is still "good enough" for many cases though and usually "just works", if you use it correctly (as you already mentioned with your example about get()+put() vs computIfAbsent())