-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Issue performance clearTimeout (especially in use-anchor.js) #15203
Comments
Hi @felipesdias! 👋 It looks like you provided an invalid or unsupported reproduction URL. Without a proper reproduction, your issue will have to get closed. Thank you for your collaboration. 👏 |
Hi. Your benchmark is not correct, since the second method does not executes clearTimeout at all. So this is not a fair comparison. |
Will investigate though. |
@rstoenescu that's the main point, avoiding the slow Aside from that, to complement the benchmark, one should create actual timeouts, and check how the additional check affects the scenarios where there is an actual timeout to clear. |
Thank you for investigating and the detailed explanation. |
What happened?
When there are many tooltip components, destroying the component can compromise performance.
I ran some profiles and found that the problem is with the clearTimeout calls in the use-anchor and use-timeout.
In my case, when switching pages in my application, it was taking 500ms-1000ms just to destroy the components (after the workaround below, the time was reduced to 40ms-80ms).
I did a performance test comparing the clearTimeout call with undefined and only calling it when the ID exists .
For now, I have replaced the default clearInterval and clearTimeout methods.
What did you expect to happen?
Before executing clearTimeout and clearInterval in all calls, should check if the ID is defined, for example as follows:
to:
Reproduction URL
https://jsbench.me/i4lcbtfdx4/1
How to reproduce?
Create a many components with tooltip and destroy then
Flavour
Quasar CLI with Webpack (@quasar/cli | @quasar/app-webpack)
Areas
Composables (quasar)
Platforms/Browsers
Chrome
Quasar info output
Relevant log output
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: