Open Bug 1883298 Opened 3 months ago Updated 3 months ago

Online OCR demo is 1.5x slower in Nightly and spends a lot of time in Baseline

Categories

(Core :: JavaScript Engine, task, P5)

task

Tracking

()

People

(Reporter: mayankleoboy1, Unassigned)

References

(Blocks 1 open bug)

Details

Go to : https://bensonruan.com/ocr-javascript-extract-text-from-image/
Select the attached image
Click to do an OCR

Chrome: https://share.firefox.dev/4c1DboG (2.6s)
Nightly: https://share.firefox.dev/3UZh9wP (3.2s)

This code is weird. It looks like it might be Emscripten output targeting asm.js, except that it's not actually using asm.js. The hotspot is a single 5K-line function. At first I thought it might be too big to Ion-compile, but that's not actually true. However, I do see that we invalidate twice for FirstExecution. I think the most likely explanation is that it takes a long time to Ion-compile this code and we invalidate before we get a chance to use it much.

This code should really be targeting wasm instead. I don't think it's particularly valuable for us to invest in optimizing this case.

Severity: -- → S4
Priority: -- → P5
You need to log in before you can comment on or make changes to this bug.