Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid copy constructor #20

Open
enerc opened this issue Jul 14, 2020 · 3 comments
Open

Avoid copy constructor #20

enerc opened this issue Jul 14, 2020 · 3 comments

Comments

@enerc
Copy link

enerc commented Jul 14, 2020

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)

@rchikhi
Copy link
Collaborator

rchikhi commented Jul 14, 2020

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

@enerc
Copy link
Author

enerc commented Jul 14, 2020

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.

@rchikhi
Copy link
Collaborator

rchikhi commented Jul 14, 2020

neat

jamshed added a commit to COMBINE-lab/cuttlefish that referenced this issue Oct 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants