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

Make TopKQueue thread-safe. Get rid of similarityHolder. #58

Merged
merged 1 commit into from
Dec 13, 2020

Conversation

alldroll
Copy link
Member

This PR makes a TopKQueue thread-safe and reuses it in different collectors. There are some improvement diffs:

benchmark                              old ns/op     new ns/op     delta
BenchmarkSuggest-8                     17364         15893         -8.47%
BenchmarkAutoComplete-8                12175         12366         +1.57%
BenchmarkRealExampleInMemory-8         42058         41371         -1.63%
BenchmarkRealExampleOnDisc-8           42134         41990         -0.34%
BenchmarkSuggestWordsOnDisc-8          115070        102630        -10.81%
BenchmarkAutocompleteWordsOnDisc-8     48066         47897         -0.35%

benchmark                              old allocs     new allocs     delta
BenchmarkRealExampleInMemory-8         331            267            -19.34%
BenchmarkRealExampleOnDisc-8           331            267            -19.34%
BenchmarkSuggestWordsOnDisc-8          604            547            -9.44%
BenchmarkAutocompleteWordsOnDisc-8     315            315            +0.00%

benchmark                              old bytes     new bytes     delta
BenchmarkRealExampleInMemory-8         15526         13476         -13.20%
BenchmarkRealExampleOnDisc-8           15543         13500         -13.14%
BenchmarkSuggestWordsOnDisc-8          21933         20067         -8.51%
BenchmarkAutocompleteWordsOnDisc-8     12666         12699         +0.26%

@alldroll alldroll merged commit c5af0db into master Dec 13, 2020
alldroll added a commit that referenced this pull request Dec 17, 2020
alldroll added a commit that referenced this pull request Dec 17, 2020
* Revert "Fix bug with missing some search result + optimize lock/unlock calls (#59)"

This reverts commit 5a466de.

* Revert "Make TopKQueue thread-safe. Get rid of similarityHolder. (#58)"

This reverts commit c5af0db.
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 this pull request may close these issues.

1 participant