1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
Author: Philip Rinn <rinni@inventati.org>
Description: Run OpenMP once before calling tesseract
Last-update: 2018-01-05
--- a/gtk/src/main.cc
+++ b/gtk/src/main.cc
@@ -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());
|