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

Enabling openmp leads to 10x performance regression on mingw-w64 #2035

Closed
jeroen opened this issue Oct 30, 2018 · 4 comments
Closed

Enabling openmp leads to 10x performance regression on mingw-w64 #2035

jeroen opened this issue Oct 30, 2018 · 4 comments

Comments

@jeroen
Copy link
Contributor

jeroen commented Oct 30, 2018

Environment

  • Tesseract Version: 4.0.0
  • Commit Number: release
  • Platform: Windows 64, mingw-w64 gcc 8.2.0

Problem

Updated the R bindings from Tesseract 3 to 4 on Windows and MacOS. However on Windows I noticed an enormous performance regression. Basic OCR examples that took 1sec before now took over 10 sec.

I noticed that the default was now to build with OpenMP which was not the case in Tesseract 3. I was able to solve the problem by rebuilding with --disable-openmp. Perhaps that should be the default on Windows

@zdenop
Copy link
Contributor

zdenop commented Oct 30, 2018

Your approach is wrong: if something does not work for you it should be turn off?

Please try to search before you post issue. Public testing of version 4 last 2 years some there must be more info experiences that yours... e.g:
#1662 (comment)
#1171 (comment)
#1081

@zdenop zdenop closed this as completed Oct 30, 2018
@amitdo
Copy link
Collaborator

amitdo commented Oct 30, 2018

Missing info:

  • Build tool: Autotools/CMake
  • Did you built it on Windows or cross-compile from another OS?
  • Number of CPU cores, does they support HyperThreading?
  • Which training data did you use?
  • Do you run it inside a VM?
  • tesseract -v output.

There is a tesseract binary for MingW-w64, prepared by @stweil.
https://github.com/UB-Mannheim/tesseract/wiki

The old engine is still available in 4.0.0.

@jeroen
Copy link
Contributor Author

jeroen commented Oct 30, 2018

We're building it native on Windows as part of msys2: https://github.com/Alexpux/MINGW-packages/blob/master/mingw-w64-tesseract-ocr/PKGBUILD (with autotools).

This example used the stock eng and osd training data from tessdata_fast. The same performance differences between T3 and T4 appear on all hardware I have tested (I'm running on 8x 2.7 GHz Intel Core i7 myself).

@jeroen
Copy link
Contributor Author

jeroen commented Oct 30, 2018

Is there a benchmarking C++ program that I can link with my build to diagnose the performance?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants