Description
We observe a performance bottleneck in byte reversing code in Apache ORC on Tez framework as shown below. We could optimize this typical code by using pattern matching in ppc.ad.
public float readFloat(InputStream in) throws IOException {
readFully(in, readBuffer, 0, 4);
int val = (((readBuffer[0] & 0xff) << 0)
+ ((readBuffer[1] & 0xff) << 8)
+ ((readBuffer[2] & 0xff) << 16)
+ ((readBuffer[3] & 0xff) << 24));
return Float.intBitsToFloat(val);
}
https://github.com/apache/orc/blob/master/java/core/src/java/org/apache/orc/impl/SerializationUtils.java
public float readFloat(InputStream in) throws IOException {
readFully(in, readBuffer, 0, 4);
int val = (((readBuffer[0] & 0xff) << 0)
+ ((readBuffer[1] & 0xff) << 8)
+ ((readBuffer[2] & 0xff) << 16)
+ ((readBuffer[3] & 0xff) << 24));
return Float.intBitsToFloat(val);
}
https://github.com/apache/orc/blob/master/java/core/src/java/org/apache/orc/impl/SerializationUtils.java
Attachments
Issue Links
- relates to
-
JDK-8241874 PPC64: Improve performance of Long.reverseBytes() and Integer.reverseBytes() on Power9
-
- Resolved
-
-
JDK-8248190 PPC: Enable Power10 system and use new byte-reverse instructions
-
- Resolved
-