- Use non-specialized PrimitiveArray like
val array: PrimitiveArray<Number> = doubleArrayOf()... - Check the generated bytecode. If you have
Double.valueOf()in it, you still have everything boxed, VM just optimizes it away.
val array: PrimitiveArray<Number> = doubleArrayOf()...
Double.valueOf() in it, you still have everything boxed, VM just optimizes it away.