Benchmarks
Compares Tesseract OCR versions 3.05, 4.1, and 5.0 across three tessdata sets, showing execution times in seconds.
View sourceWhat this file does
Compares Tesseract OCR versions 3.05, 4.1, and 5.0 across three tessdata sets, showing execution times in seconds.
When to use it
- Choosing between tessdata_best, tessdata_fast, or tessdata for your project
- Deciding whether to build Tesseract with AVX/SSE4 or OpenMP support
- Evaluating performance differences between Tesseract 3.x, 4.x, and 5.x
Assumes this stack
Benchmarks
This page is dedicated to simple benchmarking of various tesseract version and options. As input image for testing is used image from issue 236.
Results
| Build | tessdata_best | tessdata_fast | tessdata |
|---|---|---|---|
| 305 | - | - | 2.4713 |
| 413noavx | 37.6052 | 5.1589 | 10.1519 |
| 413avx | 12.7300 | 2.9538 | 4.0860 |
| 501 | 6.1981 | 2.1241 | 2.9107 |
| 501ap | 6.1369 | 2.1254 | 2.9221 |
| 501openmp | 3.4590 | 1.9612 | 2.3554 |
Information about testing environment
- Windows 10 64bit
- compiler: VS 2019
- CPU: Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz 6 cores
- memory: 16GB RAM
Tested with python code
import timeit
import time
import os
import pytesseract
start_time = time.time()
tess_exe = r"msvc.v5.openmp\tesseract.exe"
test_image = r"i263_speed.jpg"
os.environ['TESSDATA_PREFIX'] = r"tessdata_best\tessdata"
code_to_test = """
import pytesseract
pytesseract.pytesseract.tesseract_cmd = r"{}"
pytesseract.pytesseract.image_to_string(r"{}", lang = 'eng')
"""
runs = 15
elapsed_time = timeit.timeit(code_to_test.format(tess_exe, test_image), number=runs)/runs
print("\nDuration:", elapsed_time)
Tesseract build info
information provided by tesseract -v
3.05
305
It uses the legacy engine.
tesseract 3.05.02
leptonica-1.83.0 (Dec 17 2021, 17:33:37) [MSC v.1929 LIB Release x64]
libgif 5.2.1 : libjpeg 6b (libjpeg-turbo 2.0.91) : libpng 1.6.37 : libtiff 4.3.0 : zlib 1.2.11 : libwebp 1.2.0 : libopenjp2 2.4.0
4.1
413noavx
Build without AVX2/AVX/SSE4 support
tesseract 4.1.3
leptonica-1.83.0 (Dec 17 2021, 17:33:37) [MSC v.1929 LIB Release x64]
libgif 5.2.1 : libjpeg 6b (libjpeg-turbo 2.0.91) : libpng 1.6.37 : libtiff 4.3.0 : zlib 1.2.11 : libwebp 1.2.0 : libopenjp2 2.4.0
Found libarchive 3.5.1 zlib/1.2.11 liblzma/5.2.4 bz2lib/1.0.6 libzstd/1.4.9
413avx
Build with AVX2/AVX/SSE4 support
tesseract 4.1.3-1-ge9986
leptonica-1.83.0 (Jan 26 2022, 19:15:03) [MSC v.1929 LIB Release x64]
libgif 5.2.1 : libjpeg 6b (libjpeg-turbo 2.0.91) : libpng 1.6.37 : libtiff 4.3.0 : zlib 1.2.11
Found AVX2
Found AVX
Found FMA
Found SSE
Found libarchive 3.5.1 zlib/1.2.11 liblzma/5.2.4 bz2lib/1.0.6 libzstd/1.4.9
5.0
501
AVX2 supported
tesseract 5.0.1
leptonica-1.83.0 (Dec 17 2021, 17:33:37) [MSC v.1929 LIB Release x64]
libgif 5.2.1 : libjpeg 6b (libjpeg-turbo 2.0.91) : libpng 1.6.37 : libtiff 4.3.0 : zlib 1.2.11 : libwebp 1.2.0 : libopenjp2 2.4.0
Found AVX2
Found AVX
Found FMA
Found SSE4.1
Found libarchive 3.5.1 zlib/1.2.11 liblzma/5.2.4 bz2lib/1.0.6 libzstd/1.4.9
Found libcurl/7.75.0 zlib/1.2.11 libssh2/1.10.1_DEV
501ap
build with: cmake -E env CXXFLAGS="/Qpar /fp:fast" cmake ..
tesseract 5.0.1
leptonica-1.83.0 (Dec 17 2021, 17:33:37) [MSC v.1929 LIB Release x64]
libgif 5.2.1 : libjpeg 6b (libjpeg-turbo 2.0.91) : libpng 1.6.37 : libtiff 4.3.0 : zlib 1.2.11 : libwebp 1.2.0 : libopenjp2 2.4.0
Found AVX2
Found AVX
Found FMA
Found SSE4.1
Found libarchive 3.5.1 zlib/1.2.11 liblzma/5.2.4 bz2lib/1.0.6 libzstd/1.4.9
Found libcurl/7.75.0 zlib/1.2.11 libssh2/1.10.1_DEV
501openmp
The OpenMP build is known to waste a lot of CPU time.
As several users report problems, it is disabled by default in version 5.0.1 and later releases.
For other versions (>= 4.x) it is suggested to use the environment variable OMP_THREAD_LIMIT=1.
Input from OpenMP experts would be appreciated.
tesseract 5.0.1
leptonica-1.83.0 (Dec 17 2021, 17:33:37) [MSC v.1929 LIB Release x64]
libgif 5.2.1 : libjpeg 6b (libjpeg-turbo 2.0.91) : libpng 1.6.37 : libtiff 4.3.0 : zlib 1.2.11 : libwebp 1.2.0 : libopenjp2 2.4.0
Found AVX2
Found AVX
Found FMA
Found SSE4.1
Found OpenMP 2019
Found libarchive 3.5.1 zlib/1.2.11 liblzma/5.2.4 bz2lib/1.0.6 libzstd/1.4.9
Found libcurl/7.75.0 zlib/1.2.11 libssh2/1.10.1_DEV
What's inside
1 results table, 1 testing environment section, 1 Python benchmarking script, 6 build info blocks
Change this for your project
- Replace
msvc.v5.openmp\tesseract.exewith your own Tesseract executable path - Replace
i263_speed.jpgwith your own test image filename - Replace
tessdata_best\tessdatawith your own tessdata directory path
Where it goes
Keep it in your repository where the agent or team that needs it will read it.
Worth borrowing
- Benchmarking multiple build variants side by side in a single table
- Using Python's timeit for consistent timing across runs
Related Documents
Ruby 2.7
Documents every language, core class, and standard library change in Ruby 2.7 with code examples and rationale.
OABench: Benchmarking Large Language Models on the Brazilian Bar Examination
Evaluates 11 LLMs on the Brazilian Bar Exam's first phase, reporting accuracy, cost, and latency across three exam editions.
Prometheus Automation AI Marketplace - Project Documentation
Documents an enterprise AI marketplace built with Next.js 15, covering architecture, AI algorithms, security, and deployment.
Benchmarks
Compares Okra's read/write performance against raw LMDB across three dataset sizes using small key-value pairs.