Description
Follow-up on #2623 and more precisely from @alexcjohnson 's #2623 (comment)
I don't know whether the string manipulations here are a meaningful contribution to the performance... but this could all be simplified a bit (
indexOf
&.substr
instead of a regex &.replace
, no.trim
) if we could omit the space before the wordscale
. It seems to work fine in my browsers, though in principle it's not supposed to be allowed: "The individual transform definitions are separated by whitespace and/or a comma."
Alternatively, we could imagine stashing the pre-scaled transform as perhaps a
data-initialtransform
attribute on each element and avoid all this processing...
Not necessary, just a possibility if you think there would be a benefit.
which I replied:
I haven't benchmarked this particular block yet, but I know that
Drawing.setTextPointsScale
is 4-5 times slower than this routine hereDrawing.setPointGroupScale
. Spending time on making these routines faster would help improve scroll performance.