From 0858c383d546881f0a44aa1ce3e4168c155b5b60 Mon Sep 17 00:00:00 2001 From: Asadullah Khan Date: Fri, 29 Dec 2023 13:24:18 +0500 Subject: [PATCH] Update documentation for Document how incorrectly creating schedulers can cause excessive network usage #860 resolve #860 --- docs/workers_vs_schedulers.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/workers_vs_schedulers.md b/docs/workers_vs_schedulers.md index 64f79e556..203f9198d 100644 --- a/docs/workers_vs_schedulers.md +++ b/docs/workers_vs_schedulers.md @@ -49,3 +49,5 @@ const workerN = 4; While using schedulers is no more efficient for a single job, they allow for quickly executing large numbers of jobs in parallel. When working with schedulers, note that workers added to the same scheduler should all be homogenous—they should have the same language be configured with the same parameters. Schedulers assign jobs to workers in a non-deterministic manner, so if the workers are not identical then recognition results will depend on which worker the job is assigned to. + +Important Note: When workers are created one at a time for a scheduler, Chrome downloads the code and language data once for the first worker, and then uses the cached version for the later workers. However, if multiple workers are created in parallel (and the data is not already cached), Chrome appears to download new data for every worker. This behavior could cause significant issues, inflating data usage for mobile users and significantly slowing down Tesseract.js initialization times for users with slow connections. It is recommended to be mindful of this behavior when working with schedulers, especially in scenarios where multiple workers are created simultaneously. \ No newline at end of file