ByteArrayFill: Arrays.fill vs for-loop{a[i]=x} vs System.arraycopy
In Sun J2SE:
com.luzi82.codeindex.ByteArrayFill START test_Arrays_fill: 100000: 82531.7/s test_Arrays_fill: 1000000: 8102.7/s test_Arrays_fill: 10000000: 201.4/s test_manualfill: 100000: 59810.0/s test_manualfill: 1000000: 6200.7/s test_manualfill: 10000000: 200.7/s test_System_arraycopy: 100000: 80760.0/s test_System_arraycopy: 1000000: 7536.2/s test_System_arraycopy: 10000000: 201.3/s com.luzi82.codeindex.ByteArrayFill ENDAs expected, Arrays.fill > System.arraycopy >> for-loop{a[i]=x} .
In Android: Surprise. System.arraycopy >>> for-loop{a[i]=x} > Arrays.fill .
I am going to add JNI test in the coming release.
No comments:
Post a Comment