2 ms·
Buffering actually works in your favor, because when the client reads the buffered data, it's more likely to get the whole file in one go. Browsers already hav
by pornel 8y ago
Buffering actually works in your favor, because when the client reads the buffered data, it's more likely to get the whole file in one go.
Browsers already have delays and throttling for painting and relayout, because incremental rendering of HTML and DOM updates create lots of similar problems.
I don't know if browsers do it, but moving progressive image decoding to a very-low-priority thread would be an easy solution that solves 99% of the problem (nothing gets blocked, you get as much progressive rendering as you can spare CPU time).
It would be hard to be absolutely optimal about this, but my point is that in practice it's one or two extra renders, not O(n^2) you'd expect from synchronous redecoding on every byte received.