-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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&.substrinstead 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-initialtransformattribute 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.setTextPointsScaleis 4-5 times slower than this routine hereDrawing.setPointGroupScale. Spending time on making these routines faster would help improve scroll performance.