You’re not wrong. If you javap -c
it you’ll see that Scala 2 uses Tuple2$mcII$sp
(specialized) throughout, rather than an ordinary Tuple2
, to avoid boxing the Int
s. Whereas Scala 3 boxes them.
2 Likes