[core] Optimize toArray of all ByteIterators except RandomByteIterator (#1112)
Method nextBuf is a clever hack that outperforms Random.nextBytes but performs poorly for all other ByteIterator implementations This commit moves it to RandomByteIterator and adds efficient toArray implementations for other ByteIterator classes. Also InputStreamByteIterator.reset method that unconditionally throws UnsupportedOperationException is fixed
Showing
- core/src/main/java/com/yahoo/ycsb/ByteArrayByteIterator.java 11 additions, 2 deletionscore/src/main/java/com/yahoo/ycsb/ByteArrayByteIterator.java
- core/src/main/java/com/yahoo/ycsb/ByteIterator.java 2 additions, 3 deletionscore/src/main/java/com/yahoo/ycsb/ByteIterator.java
- core/src/main/java/com/yahoo/ycsb/InputStreamByteIterator.java 20 additions, 3 deletions...src/main/java/com/yahoo/ycsb/InputStreamByteIterator.java
- core/src/main/java/com/yahoo/ycsb/RandomByteIterator.java 17 additions, 3 deletionscore/src/main/java/com/yahoo/ycsb/RandomByteIterator.java
- core/src/main/java/com/yahoo/ycsb/StringByteIterator.java 11 additions, 1 deletioncore/src/main/java/com/yahoo/ycsb/StringByteIterator.java
Please register or sign in to comment