easyice commented on PR #12782: URL: https://github.com/apache/lucene/pull/12782#issuecomment-1810036730
Thank you @jpountz , I pushed the benchmark code, and added a new comparison between `ByteArrayDataInput` vs `ByteBufferIndexInput` . For `readVInt`, the `ByteBufferIndexInput` is a bit slower than `ByteArrayDataInput`. with some minor optimize, group-viarint is faster than vInt when bytes take greater than 1 bytes. >Now, I don't know if we should do it +1 >I wonder if we should write them in separate varint blocks? It's a good idea, It can use less memory when decoding. <details> <summary >Code</summary> ``` Benchmark (numBytesPerInt) (size) Mode Cnt Score Error Units GroupVIntBenchmark.byteArrayReadGroupVInt 1 64 thrpt 5 8.113 ± 1.135 ops/us GroupVIntBenchmark.byteArrayReadGroupVInt 2 64 thrpt 5 6.343 ± 0.058 ops/us GroupVIntBenchmark.byteArrayReadGroupVInt 3 64 thrpt 5 6.339 ± 0.162 ops/us GroupVIntBenchmark.byteArrayReadGroupVInt 4 64 thrpt 5 6.268 ± 0.743 ops/us GroupVIntBenchmark.byteArrayReadVInt 1 64 thrpt 5 20.325 ± 0.896 ops/us GroupVIntBenchmark.byteArrayReadVInt 2 64 thrpt 5 7.303 ± 0.350 ops/us GroupVIntBenchmark.byteArrayReadVInt 3 64 thrpt 5 4.333 ± 0.261 ops/us GroupVIntBenchmark.byteArrayReadVInt 4 64 thrpt 5 3.236 ± 0.030 ops/us GroupVIntBenchmark.byteBufferReadGroupVInt 1 64 thrpt 5 8.063 ± 0.890 ops/us GroupVIntBenchmark.byteBufferReadGroupVInt 2 64 thrpt 5 6.518 ± 0.203 ops/us GroupVIntBenchmark.byteBufferReadGroupVInt 3 64 thrpt 5 6.367 ± 0.362 ops/us GroupVIntBenchmark.byteBufferReadGroupVInt 4 64 thrpt 5 6.526 ± 0.245 ops/us GroupVIntBenchmark.byteBufferReadVInt 1 64 thrpt 5 19.794 ± 1.177 ops/us GroupVIntBenchmark.byteBufferReadVInt 2 64 thrpt 5 6.081 ± 0.144 ops/us GroupVIntBenchmark.byteBufferReadVInt 3 64 thrpt 5 4.139 ± 0.102 ops/us GroupVIntBenchmark.byteBufferReadVInt 4 64 thrpt 5 3.112 ± 0.049 ops/us ``` </details> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
