Skip to content

Investigate ways to make svg scroll faster #2625

Closed
@etpinard

Description

@etpinard

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 word scale. 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 here Drawing.setPointGroupScale. Spending time on making these routines faster would help improve scroll performance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions