Skip to content

Commit

Permalink
Add benchmark to measure performance of CustomBinaryDocValuesField
Browse files Browse the repository at this point in the history
Benchmarks show that ArrayList performs better than TreeSet. Added a comment
on where to find the results and benchmark.

Signed-off-by: Kiran Reddy <kkreddy@amazon.com>
  • Loading branch information
kkmr committed Aug 29, 2023
1 parent 60787b8 commit c3ff05d
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@ protected String contentType() {
*/
public static class CustomBinaryDocValuesField extends CustomDocValuesField {

// We considered using a TreeSet instead of an ArrayList here.
// Benchmarks show that ArrayList performs much better
// For details, see: https://github.com/opensearch-project/OpenSearch/pull/9426
// Benchmarks are in CustomBinaryDocValuesFiledBenchmark
private final ArrayList<byte[]> bytesList;

public CustomBinaryDocValuesField(String name, byte[] bytes) {
Expand Down

0 comments on commit c3ff05d

Please sign in to comment.