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

Precoumpte totals to give exact response fast in autocomplete #2620

Merged
merged 3 commits into from
Jul 28, 2022

Conversation

awildturtok
Copy link
Collaborator

No description provided.

@awildturtok awildturtok requested a review from thoniTUB July 27, 2022 09:50
Comment on lines +175 to +187
totals = new Object2LongAVLTreeMap<>(
allSelectFilters.parallelStream()
.collect(Collectors.toMap(
Functions.identity(),
filter -> filter.getSearchReferences().stream()
.map(synchronizedResult::get)
.flatMap(TrieSearch::stream)
.mapToInt(FEValue::hashCode)
.distinct()
.count()
)));


Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Du könntest überlegen ob du totals zu einem Future machst, damit die Jobqueue nicht blockiert. Du hast ja beschrieben, dass das sehr langsam sein kann

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ne das sind maximal 5sec/Filter aber eher weniger. Und ein Job der durchläuft aber nicht fertig ist finde ich problematisch.

@awildturtok awildturtok merged commit da061eb into develop Jul 28, 2022
@delete-merged-branch delete-merged-branch bot deleted the test/count-search-result-in-advance branch July 28, 2022 07:46
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.

2 participants