Benchmarking the cost of Java's EnumSet - A Second Look
kinnen.de·4h·
Discuss: r/programming
Flag this post

2024-01-05 - Thomas Kinnen

A few months ago, I read Chris Wellons’ “The cost of Java’s EnumSet”. I really enjoyed the read, but as a long time Java developer, I was left with few questions and thoughts:

  1. “Is Java’s EnumSet really that slow? 3 orders of magnitude feels like a way too big margin.”
  2. “Writing benchmarks in Java is inherently tricky, especially for small and fast operations. We should probably use a dedicated tool like JMH for that.”

Now I finally had some time on my hands to go and explore these thoughts and try to fill the void with some cold hard data. This post will first explain a few important aspects of profiling java and then discuss the results of our sp…

Similar Posts

Loading similar posts...