From 5fcdcbd2a9e785b5c60f6b469f6726b431532210 Mon Sep 17 00:00:00 2001 From: Robert Knight Date: Tue, 20 Feb 2024 13:13:34 +0000 Subject: [PATCH] Add stronger hint to users to build `ocrs` and `rten*` crates in release mode Debug builds, especially of the `rten*` crates, are an order of magnitude or more slower. --- ocrs/README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ocrs/README.md b/ocrs/README.md index ac306c4..500a3b6 100644 --- a/ocrs/README.md +++ b/ocrs/README.md @@ -5,6 +5,11 @@ This crate contains the **ocrs** OCR engine as a library. See the [main_readme]: https://github.com/robertknight/ocrs/blob/main/README.md +## Performance note + +Make sure you build the `ocrs` crate and its `rten*` dependencies in **release +mode**. Debug builds of these crates will be extremely slow. + ## Usage See [examples/hello_ocr.rs](./examples/hello_ocr.rs) for a minimal example of using this library in @@ -17,5 +22,5 @@ cd examples/ ./download-models.sh # Run OCR on an image and print the extracted text. -cargo run -r --example hello_ocr rust-book.jpg +cargo run --release --example hello_ocr rust-book.jpg ```