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

Run OpenMP once before calling tesseract (fixes: #285) #286

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions gtk/src/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ int main (int argc, char *argv[]) {
}
#endif

// Run OpenMP once before tesseract is called, otherwise it might be
// _very_ slow, see https://github.com/manisandro/gImageReader/issues/285
// Sleep 1 millisecond to prevent being optimized out.
#pragma omp parallel for schedule(static)
for(int i = 0; i < 1; i++) { sleep(1); }

std::string localeDir = Glib::build_filename(pkgDir, "share", "locale");

bindtextdomain(GETTEXT_PACKAGE, localeDir.c_str());
Expand Down