Java's varargs performance

前端 未结 5 552
北荒
北荒 2020-12-03 21:18

Coding i came around to check for the vararg performance of Java.

I write following test code:

public class T {

    public static void main(String[         


        
5条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-03 22:02

    As said, an array is maintained when using var-args...,

    you should also try to see the influence of adding "final" to the parameters of every methods

    i personally get an improvement from 2250 -> 2234 ms for the array.

提交回复
热议问题