Closed tryggvigy closed 6 months ago
Unfortunately getting some build error when trying to spin up the react example locally so I'm not able to try things out at the moment
@tryggvigy I'm looking into it! - So whats happening here is that on resizing the window I'm checking whether I need to update initialized OverlayScrollbar
instances. For this I'm measuring the viewport
element of the instance, but before I can measure it reliably I have to apply an style to make the measurement "correct" (because of certain browser behaviors).
This logic did not change between v2.7.3
and v2.8.0
though.. So I'm not 100% certain what could be the reason here.
@tryggvigy to spin up the example try to run npm run example:react
from the root directory of the repo.. the command should handle everything for you
@tryggvigy I believe I've found the issue(s). Is there a possibility we could test this together / have a better communication channel (e.g. Slack, Discord, ...) than this issue thread? Then I could pass you the builds and you could test them
Amazing! Yes, I'd be happy to. I can do discord. I'll reach out when I'm back from lunch here :)
I've emailed you my Discord!
I've added you :)
same. when to fix
We are working on it @xmsz-stu 👍 should be quite soon
@tryggvigy @xmsz-stu I've published v2.8.3
which includes the needed performance improvements.. Additionally I've added performance metrics which will hopefully help in catching such regressions in the future :)
Describe the bug Hey there! We noticed after bumping from
2.7.3
to2.8.0
there was a big drop in window resizing performance.To Reproduce Steps to reproduce the behavior:
data-overlayscrollbars-viewport
is written to the same value in the DOM on every resize event.https://github.com/KingSora/OverlayScrollbars/assets/2373958/abbfcea7-e38c-4426-93b4-231e2aa7214a
At least I think this is the issue! As a result I believe the browser has to do style recalculations again each resize as this data attribute is used in CSS:
As we have quite a complex app with lots of css and dom nodes, the browsers "Recalculate Styles" block is quite expensive and lots of frames are dropped during resize of the window. In the end we decided to roll back to
2.7.3
.I wonder if skipping writing the
data-overlayscrollbars-viewport
to the DOM if it did not change would help resize performance.I'm going to look into this a bit but posting the issue here first in case someone has a hunch of what could be causing this issue.