How Tesseract Runs Inside a Tab
Tesseract.js loads the compiled Tesseract core as WebAssembly, plus a traineddata file per language, into a Web Worker. The LSTM recogniser needs the core module and the language model; English fast data is a few megabytes, while Chinese packs are larger still and best-quality models run to tens of megabytes. Initialisation dominates the first run, while subsequent pages reuse the worker and only pay per-image inference.
Recognition is not a single pass. Tesseract binarises internally, finds text lines with a layout analyser, segments them into words, then runs the LSTM over each line with a dictionary and shape classifier. That pipeline explains why page segmentation mode changes results so much: the wrong mode feeds the recogniser lines it never expected to see.