Description
Thanks to @willmcgugan I have some heavy load examples to test on the DOM renderer, in particular:
- the colortest file for here
textual easing
to spot render glitches and update behavior (install withpip install textual-dev
)
Issues found so far:
-
The PR Fix for #2488. Use element offsetHeight rather than getBoundingRect #4366 changed char measuring to the integer based value retrieved from
offsetWidth
. Already suspected this to introduce artifacts for the letter-spacing trick, where rounding offsets will stack up, and yes it does showing staggering at the right side (scale demo to 310x70 to see the colortest file at full glory):Not sure yet what the right solution to this is, at least
getBoundingRect
gets the values right not showing the staggering. -
getAttribute
&setAttribute
are very expensive in the colortest accounting for 50% of script runtime (~800 ms), we prolly should resort to collectingstyle
entries in JS and setting it only once on the element. -
Overall render runtime is bad for the colortest, it takes ~3 s on my machine. Can be made faster by:
display: inline
lowers render time to 2.3 s (measured, inline-block vs inline in DOM renderer #4632)- fixing
setAttribute
minus ~500 ms --> down to 1.8 s - selection bug better handleSelectionChanged in DOM renderer #4633 minus ~300 ms --> down to 1.5 s
Still underwhelming, but at least ~2x faster (note that the webgl renderer takes only ~50 ms to paint colortest).
-
As already mentioned by @mofux, block chars render poorly in the DOM renderer.
textual
uses those to color its surface, which results in ugly stripes. It is also the root cause for the staggering above, as colortest also uses different block chars. We should investigate, if we can draw block chars ourselves not relying on the font renderer. -
textual easing
does some weird color trickery at the menu on the left side to give the illusion of raised button borders. While the canvas and the webgl renderer show these, the DOM renderer shows plain colors. Prolly related to our decoration/line-height in the DOM renderer.