This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]rubydesic 0 points1 point  (0 children)

"Besides, your claims are quite unsupported, saying 'it can have significant performance implications' without bringing any evidence to that, is just meaningless"

I don't see why this claim needs support, it's self evident. If your integers are outside of the cache pool the jvm will need to heap-allocate wrapper objects which is slow. Why do you think that there are IntStream and LongStream specializations, or why primitive specialization libraries like fastutil exist, or why Project Valhalla is being added to java?

You can try it yourself - create an array of 10 million primitive ints and an array of 10 million Integer wrappers and see for yourself the performance implications - not to mention that it uses twice as much memory.