Library Performance Versus CLI
Grant3W opened this issue · 3 comments
Thank you for your work on this project. It looks really exciting and I can't wait to start using this in my projects. I've spun up the example you give from the library, however, the performance seems to be degraded compare to the CLI.
When running from a Rust project with ocrs as a library, my image took ~30 seconds, whereas the same image took ~1 second with the CLI.
Any idea where I could be going wrong? I can see from debugging that the delay is coming from the phase1 and phase 3 calls from the example. I tried turning debug off, but that hasn't helped.
Please disregard this. I simply needed to mark the build as release with --release
and this resolved the issue.
The rten
dependency is the machine learning runtime which has to always be compiled in release mode for reasonable performance. Other parts of the code can be compiled in debug mode for better backtraces etc. I should make a note of this in the README.
That's good to know, I appreciate the explanation.