mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-24 02:09:28 +00:00
Before this change, we would process each image as it finished downloading. This often led to a situation where we'd decode 1 image, schedule a layout, do the layout, then decode another image, schedule a layout, do the layout, etc. Basically decoding and layouts would get interleaved even though we had multiple images fetched and ready for decoding. This patch adds a simple BatchingDispatcher thingy that HTMLImageElement uses to batch the handling of successful fetches. With this, the number of layouts while loading https://shopify.com/ goes from 48 to 6, and the page loads noticeably faster. :^)
38 KiB
38 KiB