Test execution time
By default this module will check if you have a local installation of Tesseract on your machine/in your pipeline. If you don't have a local installation it will automatically use a NodeJS version. This might cause some slowness because the image processing will be done by Node.js. NodeJS is not the best system to do heavy processing.
BUT...., there are ways to optimize the execution time. Let's take the following test script
When you execute this for the first time on a local Android emulator and a local iOS simulator you might see the following results.
#
Re-using already processed imagesYou can optimize the execution time by re-using the already processed images by providing the option {reuseOcr: true}
for the following commands:
If you would then change the script to this:
Then you will see a different execution time.
Re-use images
This reduced the local execution time from 2 minutes to 1 minute.
#
Cropping the search area of a screenYou can optimize the execution time by:
- AND re-using the already processed images by providing the option
{reuseOcr: true}
, see Re-using already processed images. - AND by providing a cropped area for Android and or iOS to execute the OCR on.
info
Be aware of the fact that each device has its own screen resolution. You need to understand that this could lead to different text in that cropped area because a smaller screen will hold less information than a bigger screen.
You can provide AND Android AND iOS rectangles through the options for the following commands:
in the following format:
If you would then change the script to this:
Then you will see a different execution time.
Cropping images
This reduced the local execution time from 2 minutes to 20-25 seconds!.
#
Using a local installation of TesseractYou can speed up your execution time to even less than a minute if you would have a local installation of Tessarect on your local machine and or in your pipeline (more information about installing Tesseract on your local system can be found here). You can find the execution time of the same script using a local installation of Tesseract below.
Local installation
This reduced the local execution time from 2 minutes to 15-20 seconds!.