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

Tune translate_cds implementation #80

Closed
holtgrewe opened this issue Mar 31, 2023 · 5 comments · Fixed by #81
Closed

Tune translate_cds implementation #80

holtgrewe opened this issue Mar 31, 2023 · 5 comments · Fixed by #81

Comments

@holtgrewe
Copy link
Contributor

A lot of time in mehari is consumed in the translate_cds implementation.

We should properly tune and benchmark this function in hgvs-rs.

@holtgrewe
Copy link
Contributor Author

holtgrewe commented Apr 3, 2023

cargo bench result for current phf implementation

image

@holtgrewe
Copy link
Contributor Author

After switching to byte arrays with builtin match (two changes, not 100% clear where time is added/lost).

image

@holtgrewe
Copy link
Contributor Author

Note: converting to a hard-coded trie (nested match) does not help. Creating result with capacity helps a bit (5%).

@holtgrewe
Copy link
Contributor Author

Even faster, with fast hash maps

image

@holtgrewe
Copy link
Contributor Author

Changing everything to bytes makes the interfaces painful.

I found an implementation that will allow to keep interfaces using str and String but still gives a speedup of almost 4x.

image

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

Successfully merging a pull request may close this issue.

1 participant