mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 03:09:08 +00:00
The BatchingDispatcher mechanism is used by HTMLImageElement to avoid decoding one image at a time, since interleaving decode/layout/repaint over and over takes way more time than doing many decodes followed by a single layout/repaint pair. Before this change, we didn't have a limit on how many batched loads we'd allow ourselves to queue up, which could lead to situations where more and more images kept being added to the queue, and never getting processed. This fixes the issue by putting an arbitrary limit (16) on the number of batched image loads, and then allowing the flush to happen after that instead of re-deferring processing.
46 KiB
46 KiB