-
Enhancement
-
Resolution: Fixed
-
P4
-
8u131, 9, 10
-
b13
In cases like UnixFileSystem.getBooleanAttributes0, the path of a File is transformed to a natively encoded char* by JNI code, with fast paths for various legacy charsets such as ISO-8859-1 and cp1252. In the case this encoding is UTF-8, however, there is no fast path, which means the JNI code will do an upcall to String.getBytes("UTF-8").
Experiments (using the modified UTF-8 utilities available to JNI) indicates this can be quite a bit faster due to avoiding creating a temporary byte[], meaning a fast path for UTF-8 can help to achieve a speedup and reduce GC pressure when converting a lot of java Strings to native UTF-8 strings.
Experiments (using the modified UTF-8 utilities available to JNI) indicates this can be quite a bit faster due to avoiding creating a temporary byte[], meaning a fast path for UTF-8 can help to achieve a speedup and reduce GC pressure when converting a lot of java Strings to native UTF-8 strings.