-
Notifications
You must be signed in to change notification settings - Fork 13
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
Implement concurrent highlighting on multiple threads (#64) #429
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jbaiter
changed the title
Draft: Implement concurrent highlighting on multiple threads (#64)
Implement concurrent highlighting on multiple threads (#64)
May 10, 2024
jbaiter
force-pushed
the
concurrent-highlighting
branch
from
May 10, 2024 09:19
c2fca29
to
51bd67e
Compare
schmika
reviewed
May 10, 2024
schmika
reviewed
May 10, 2024
jbaiter
force-pushed
the
concurrent-highlighting
branch
from
May 10, 2024 09:54
51bd67e
to
cd48938
Compare
- Concurrency is per-(doc, field) combination, i.e. when highlighting 2 field in 10 documents, 20 threads should be used - Thread number and maximum number of queued highlighting tasks can be controlled with the new `numHighlightingThreads` and `maxQueuedPerThread` attributes on the `OcrHighlightComponent` config. - Includes a benchmarking suite that runs against the example index (`example/bench.py`)
jbaiter
force-pushed
the
concurrent-highlighting
branch
from
May 10, 2024 11:10
cd48938
to
527f91d
Compare
jbaiter
force-pushed
the
concurrent-highlighting
branch
from
May 10, 2024 12:50
527f91d
to
886d31a
Compare
schmika
reviewed
May 10, 2024
We were storing the number of matches in a non-thredsafe `HashMap`, which led to a race condition when writing to it from multiple threads. We now use a threadsafe `ConcurrentHashMap` to avoid this. Additionally, we now use `CompleteableFuture`s for waiting on our asynchronous highlighting threads instead of raw `Future`s.
Now that we support concurrent highlighting, it's no longer needed.
jbaiter
force-pushed
the
concurrent-highlighting
branch
from
May 23, 2024 06:57
6623265
to
4d1f5a0
Compare
schmika
approved these changes
May 23, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
numHighlightingThreads
andmaxQueuedPerThread
parameters✨ Performance Gains ✨ on a machine with 24 logical cores and enough RAM to hold the index and OCR data in the page cache (i.e. I/O does not play a relevant role):