Java Switch Performance: Should You Use String or int?
Using JMH, this article benchmarks Java switch statements, comparing the traditional int‑based switch (via String hashCode) against the newer String‑based switch, showing that the int version runs roughly twice as fast while warning about hashCode collisions.
