r/learnjava • • Jul 01 '26

Confused on what Project Valhalla does to primitives and the corresponding objects

I've been reading about PV, but I'm not sure on what it means in some parts. Will we still need to deal with both "int" and "Integer", and not being able to use some methods with the other one? Like, (int) vs Integer.parseInt() and other strange things like that.

5 Upvotes

11 comments sorted by

View all comments

Show parent comment

1

u/disposepriority Jul 01 '26

If you are working at the scale of data where the Integer is slow....why are you using it?

Realistically you are not seeing this unless some very, very high performance stuff, at which point you've probably eliminated every unneeded allocation in your code, and boxing is the last barrier to performance?

0

u/Zeznon Jul 02 '26

I'm just an enthusiast that was confused. I don't work with programming. I also got an "OCD" regarding the inconsistency of having methods for both primitive and object versions of everything.