Improve content parsing performance for large PDF asset #9051
+119
−36
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.
feat(assets): improve PDF asset parser performance (#9037)
Improve PDF parsing using a worker pool
This commit will change the single-threaded behavior of PDF parser into a multi-threaded worker pool speeding up PDF parsing performance multiple times.
By default the number of available CPU cores will be used to create a worker pool that will process the PDF pages. The pages are split up and feed into the pool returning text results for every PDF page that will be sorted and joined afterwards.
My internal tests using this approach showed on an old i5 (4 cores CPU) a speedup of 3x - 4x faster than the single-threaded previous version.