Skip to content

Investigate ways to make svg scroll faster #2625

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
etpinard opened this issue May 10, 2018 · 2 comments
Closed

Investigate ways to make svg scroll faster #2625

etpinard opened this issue May 10, 2018 · 2 comments

Comments

@etpinard
Copy link
Contributor

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.

@etpinard
Copy link
Contributor Author

When playing around with alternatives to regex .replace and .trim, we'll need to test them out in different browsers (all the way to IE9). I can imagine browsers not handling svg transform lists the exact same way.

@gvwilson
Copy link
Contributor

Hi - this issue has been sitting for a while, so as part of our effort to tidy up our public repositories I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our stack. Cheers - @gvwilson

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants