render 20+ styles at once

so that the page on a typical 1080p display is completely filled in initial frame at 200ms
This commit is contained in:
tophf 2017-12-24 10:03:13 +03:00
parent 53eac84312
commit 12fe1b619f

View File

@ -134,7 +134,7 @@ function showStyles(styles = []) {
while ( while (
index < sorted.length && index < sorted.length &&
// eslint-disable-next-line no-unmodified-loop-condition // eslint-disable-next-line no-unmodified-loop-condition
(shouldRenderAll || ++rendered < 10 || performance.now() - t0 < 10) (shouldRenderAll || ++rendered < 20 || performance.now() - t0 < 10)
) { ) {
renderBin.appendChild(createStyleElement(sorted[index++])); renderBin.appendChild(createStyleElement(sorted[index++]));
} }