r/ProgrammerTIL • • Oct 22 '17

Other [Java] HashSet<T> just uses HashMap<T, Object> behind the scenes

76 Upvotes

35 comments sorted by

View all comments

Show parent comment

1

u/an_actual_human Oct 25 '17

I suspect the overhead is negligible in practice in most cases where you'd use Java at all. I'd be curious to look at the profiling data, but I wouldn't profile myself in all honesty. That said, I agree that it is indeed unclean.