Skip to content

Commit

Permalink
Update workers_vs_schedulers.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Balearica authored Oct 19, 2023
1 parent 04d1c80 commit a76ba6d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/workers_vs_schedulers.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Tesseract.js offers 2 ways to run recognition jobs: (1) using a worker directly, or (2) using a scheduler to run jobs on multiple workers in parallel. The syntax for the latter is more complicated, but using parallel processing via schedulers provides significantly better performance for large jobs. For more detailed documentation on each function, see the [api page](./api.md).

# Option 1: Using Workers Directly
Tesseract.js also supports creating and managing workers (the objects that execute recognition) manually.
The following snippet recognizes text from an image using a single worker.

```
(async () => {
Expand Down Expand Up @@ -48,4 +48,4 @@ 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.
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.

1 comment on commit a76ba6d

@Neo9050
Copy link

@Neo9050 Neo9050 commented on a76ba6d Nov 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

old - involves using workers directly, managing them manually for individual tasks. updated - employs schedulers for parallel execution, allowing simultaneous processing of multiple jobs with added complexity but improved performance for large tasks. The key decision revolves around the trade-off between simplicity and efficiency in handling recognition jobs.

Please sign in to comment.