Memory comparison of scala array [int] V / s int [] in Java?
•
Java
Do they have the same memory? Array is an abstract class, so will it cause any object title cost? Are other Java primitive arrays in scala the same?
PS: I read somewhere that Scala stores them as raw arrays in the JVM, but now I'm confused
Solution
Scala's array [t] is completely expressed as Java's t [], with no overhead They generate the same bytecode You also have the operation provided by arrayops, but it is an implicit conversion and will not affect the pure array [t] representation
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码