Skip to content
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

Optimise performances for multiple instances in a page #205

Closed
Grsmto opened this issue Sep 14, 2018 · 2 comments
Closed

Optimise performances for multiple instances in a page #205

Grsmto opened this issue Sep 14, 2018 · 2 comments

Comments

@Grsmto
Copy link
Owner

Grsmto commented Sep 14, 2018

Multiple instances of the plugin could share some infos like the native scrollbar width so they don't need to calculate this individually.
Basically setting some data as static within the SimpleBar class.

@adjourn
Copy link

adjourn commented Feb 21, 2019

Good idea, accessing offsetWidth (which you have to do when measuring scrollbar width) triggers styles recalculation and it basically doubles the initialization time (if already have DOM ready, don't know what are the ratios if have to build DOM too). All other calculations and adding listeners are almost nothing next to it.

@Grsmto
Copy link
Owner Author

Grsmto commented Oct 8, 2019

Done in #373

@Grsmto Grsmto closed this as completed Oct 8, 2019
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