Hacker News new | ask | show | jobs
by eonwe 3570 days ago
JVM doesn't know about generic types at the runtime. There's no specialization of HashMaps, it's just arrays of points to objects all around.

With project Valhalla: https://en.wikipedia.org/wiki/Project_Valhalla_(Java_languag... there's been talk about specialization for value types.

2 comments

It is already available for those that want to play with it.

https://adoptopenjdk.gitbooks.io/adoptopenjdk-getting-starte...

I too thought the same. That's why pcwalton's comment confused me.