The app is used to test the performance and behavior of Java code.
You may get the src from https://github.com/luzi82/CodeIndex .
Here is the first test case:
ByteArrayCopy: System.arraycopy vs for-loop{dest[i]=src[i]}
In Sun J2RE:com.luzi82.codeindex.ByteArrayCopy START test_System_arraycopy: 100000: 53210.0/s test_System_arraycopy: 1000000: 5215.3/s test_System_arraycopy: 10000000: 152.8/s test_manualcopy: 100000: 42231.6/s test_manualcopy: 1000000: 4033.9/s test_manualcopy: 10000000: 150.8/s com.luzi82.codeindex.ByteArrayCopy END
In Android:
Conclusion: System.arraycopy win. Use System.arraycopy, esp in Android.
No comments:
Post a Comment