Closed jtaylor-sfdc closed 10 years ago
I did a test with a custom comparator that makes use of the fact the the JDK only passes the search term to the right side of the comparator during a binary search (that let's us to (1) avoid creating a KV for each search (2) avoid alternate instanceofs and (3) inline the search condition into the comparator itself.
A microbenchmark shows that this cuts search time by 40-50% (for KVs with 30byte rowKeys, 5byte families, and 20byte qualifiers). The saving will be greater for larger KVs.
When I'll get time I'll add that to Phoenix, test, and send a pull request.
Thanks, @lhofhansl. Looking forward to the patch.
@lhofhansl implemented this through a custom comparator. Thanks for the contributions!
Couple of different options:
Thanks for pointing this out, @lhofhansl