Is Java's System.arraycopy() efficient for small arrays?

前端 未结 7 2009
独厮守ぢ
独厮守ぢ 2020-12-02 13:01

Is Java\'s System.arraycopy() efficient for small arrays, or does the fact that it\'s a native method make it likely to be substantially less efficient than a s

7条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-02 13:27

    System.arraycopy use a memmove operation for moving words and assembly for moving other primitive types in C behind the scene. So it makes its best effort to move as much as efficient it can reach.

提交回复
热议问题