jfboeuf commented on PR #13989:
URL: https://github.com/apache/lucene/pull/13989#issuecomment-2471157022

   @jpountz 
   [I modified the benchmark to make it more realistic by adding a header to 
the `IndexOutput` 
](https://github.com/apache/lucene/commit/8dc6eac23b3a1158ef4c82860d8574c779bad047)
 so:
   * `updateLongs(long[], int, int)` triggers a real flush before processing 
(the benchmark was biased because the buffer was empty, which is unlikely in 
real operations where there is at least the header and the table size before).
   * write accesses to the buffer by `updateLong(long)` are not necessarily 
aligned (they are always with the new `updateLongs(long[], int, int)`).
   
   After testing with different sizes of `long[]` it seems the loop of 
`updateLong(long)` is only worth it for **really small** arrays and this 
specific case probably doesn't deserve the additional complexity/if_branch in 
`updateLongs(long[], int, int)`.
   ```
   Benchmark                                              (size)   Mode  Cnt    
 Score     Error   Units
   BufferedChecksumIndexInputBenchmark.decodeLongArray         8  thrpt   15  
5992.000 ± 123.429  ops/ms
   BufferedChecksumIndexInputBenchmark.decodeLongArray        16  thrpt   15  
5729.068 ± 123.423  ops/ms
   BufferedChecksumIndexInputBenchmark.decodeLongArray        32  thrpt   15  
5307.703 ± 149.885  ops/ms
   BufferedChecksumIndexInputBenchmark.decodeLongArray        64  thrpt   15  
4960.178 ± 124.810  ops/ms
   BufferedChecksumIndexInputBenchmark.decodeSingleLongs       8  thrpt   15  
6182.986 ± 253.181  ops/ms
   BufferedChecksumIndexInputBenchmark.decodeSingleLongs      16  thrpt   15  
5472.158 ± 190.560  ops/ms
   BufferedChecksumIndexInputBenchmark.decodeSingleLongs      32  thrpt   15  
4739.634 ± 404.963  ops/ms
   BufferedChecksumIndexInputBenchmark.decodeSingleLongs      64  thrpt   15  
3858.685 ±  81.880  ops/ms
   ```
   @rmuir I'll add unit tests to thoroughly check the method behaves properly.


-- 
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: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to