DomGarguilo commented on issue #2812:
URL: https://github.com/apache/accumulo/issues/2812#issuecomment-1187918885

   I've run an updated version of [the 
benchmark](https://issues.apache.org/jira/secure/attachment/12829691/benchmark.tar.gz)
 from [the original jira 
ticket](https://issues.apache.org/jira/browse/ACCUMULO-4468) and the results I 
received seem significant
   ```
   Benchmark                    Mode  Cnt   Score   Error  Units
   MyBenchmark.customDom       thrpt   25  56.241 ± 0.458  ops/s
   MyBenchmark.customVanilla   thrpt   25  53.248 ± 0.475  ops/s
   MyBenchmark.customWill      thrpt   25  92.400 ± 0.935  ops/s
   MyBenchmark.standardEquals  thrpt   25  51.610 ± 0.470  ops/s
   ```
   The `MyBenchmark.customWill` is the relevant `equals()` method with its 
comparison reversed. This looks like this:
   ```java
     public boolean willEquals(WillKey other, PartialKey part) {
       switch (part) {
         case ROW_COLFAM_COLQUAL_COLVIS_TIME_DEL:
           if (deleted != other.deleted)
             return false;
         case ROW_COLFAM_COLQUAL_COLVIS_TIME:
           if (timestamp != other.timestamp)
             return false;
         case ROW_COLFAM_COLQUAL_COLVIS:
           if (!isEqual(colVisibility, other.colVisibility))
             return false;
         case ROW_COLFAM_COLQUAL:
           if (!isEqual(colQualifier, other.colQualifier))
             return false;
         case ROW_COLFAM:
           if (!isEqual(colFamily, other.colFamily))
             return false;
         case ROW:
           return isEqual(row, other.row);
         default:
           throw new IllegalArgumentException("Unrecognized partial key 
specification " + part);
       }
     }
   ```
   Compared to the current code:
   
https://github.com/apache/accumulo/blob/36dd78ce6bbc2aae8db72014b8703f94b9b92ded/core/src/main/java/org/apache/accumulo/core/data/Key.java#L977-L1002
   I did add another equals method to the benchmark for testing in relation to 
#2811 represented by `MyBenchmark.customDom` in the benchmark printout. For 
those interested that method can be found 
[here](https://gist.github.com/480e5ed9fdaadd0813ca7647f8acabbe).


-- 
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]

Reply via email to