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

implemented ability to limit number of threads used by tesseract #123

Merged
merged 3 commits into from
May 11, 2018
Merged

Conversation

suud
Copy link
Contributor

@suud suud commented May 11, 2018

Running multiple content-extraction-jobs in parallel on one machine leads to an enormous increase of execution time (see tesseract-ocr/tesseract#1019). One solution is to limit the number of threads usable by tesseract. If you have 4 cores and limit the number of threads used by tesseract to two, two parallel extractions are working fine.
Sadly, there is no built-in option for tesseract to limit the number of threads. But it's possible to do so with the OMP_THREAD_LIMIT-command.

Grüße nach Berlin!

Repository owner deleted a comment May 11, 2018
Repository owner deleted a comment May 11, 2018
Repository owner deleted a comment May 11, 2018
Repository owner deleted a comment May 11, 2018
@thiagoalessio
Copy link
Owner

Hallo @suud thank you very much for finding that out and contributing back! is a really nice addition to the library, will merge and bump the version to make it already available ;D
🖤 ❤️ 💛

@thiagoalessio thiagoalessio changed the base branch from master to pr-123 May 11, 2018 13:57
@thiagoalessio thiagoalessio merged commit 0d5596b into thiagoalessio:pr-123 May 11, 2018
@suud suud deleted the thread-limit branch May 11, 2018 14:08
thiagoalessio added a commit that referenced this pull request May 11, 2018
@thiagoalessio
Copy link
Owner

FYI, I needed to move threadLimit to the Command class in order to unit test it, which changed a bit your proposed API, but the feature is already present on version 2.4.0, thanks again 👍 🎉 🎈

@suud suud restored the thread-limit branch May 11, 2018 14:35
@suud suud deleted the thread-limit branch May 11, 2018 14:39
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