BBHash icon indicating copy to clipboard operation
BBHash copied to clipboard

Avoid copy constructor

Open enerc opened this issue 4 years ago • 3 comments

First thanks for this great stuff! Lookup can be 3x faster on strings with the following changes: uint64_t lookup(const elem_t &elem) uint64_t getLevel(hash_pair_t & bbhash,const elem_t &val,int * res_level, int maxlevel = 100, int minlevel =0)

enerc avatar Jul 14 '20 10:07 enerc

looks good, thanks! I applied the fix on master branch and alltypes branch. Tests pass.

I do see a speed improvement in the alltypes branch: before:

$ ./example_custom_hash_strings  2000000  1
Query of 2000000 key  in 0.27s

after:

Query of 2000000 key  in 0.18s

rchikhi avatar Jul 14 '20 15:07 rchikhi

The 3x speed increase I have is because I use Aquahash for hashing (https://github.com/jandrewrogers/AquaHash) and string_views instead of string (c++17). Using AES CPU instructions speed hashing a lot.

enerc avatar Jul 14 '20 17:07 enerc

neat

rchikhi avatar Jul 14 '20 17:07 rchikhi