Since System.arraycopy() relies on a native library, is it faster to recode the functionality in Java and rely on JIT/HotSpot to improve performance?

John Zukowski

While calling a native function requires some setup time, at least according to the Java Performance and Scalability, Volume I : Server-Side Programming Techniques, after a size of about 8 bytes the native function is faster. As the array size increases, the performance improvement increases. For instance at 256 bytes (still relatively small), System.arraycopy() is 5 times faster than assignments in a for loop.

0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



About | Sitemap | Contact