RandomAccessFile performs operations for the longer primitives (e.g. int and long) using several invocations of native JNI methods. For example, readLong() invokes 8 JNI method calls.
It would be better to perform these operations in bulk. In the example above, the readLong() would only do one JNI method call. This is likely to improve performance with a factor of almost eight for long/double operations and with a factor of almost four for int/float operations.
As this class is used by other JDK classes (e.g. for image handling), the performance improvements would propagate to these classes.
It would be better to perform these operations in bulk. In the example above, the readLong() would only do one JNI method call. This is likely to improve performance with a factor of almost eight for long/double operations and with a factor of almost four for int/float operations.
As this class is used by other JDK classes (e.g. for image handling), the performance improvements would propagate to these classes.
- duplicates
-
JDK-8292937 Improve performance of some read operations of RandomAccessFile
-
- Closed
-