You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have run into an obvious performance bottleneck with my app:
The relevant part of Vue.js code is in updateTeleports in useCssVars
There document.querySelectorAll(``[data-v-owner="${instance.uid}"]``) is called, but if I see it correctly, it can becalled multiple times in setVars, but the result of the query selector is the same for the instance. Wouldn't is make sense to cache the result from the first call to querySelectorAll() here?
My app has far too many components and I will reduce the number significantly, so this performance problem will get solved in another way, but maybe this could help improve performance of other cases. It is just an idea that I thought may be easy to implement. Don't hesitate to dismiss it if I am wrong or if you think it's not worth the hassle.
Edit: I think I am wrong with my assumption that the result of querySelectorAll() can be cached, but if this is a performance issue that others see, too, it may be worth thinking about storing the data-v-owner relations in more performant way.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have run into an obvious performance bottleneck with my app:
The relevant part of Vue.js code is in
updateTeleports
inuseCssVars
There
document.querySelectorAll(``[data-v-owner="${instance.uid}"]``)
is called, but if I see it correctly, it can becalled multiple times insetVars
, but the result of the query selector is the same for the instance. Wouldn't is make sense to cache the result from the first call toquerySelectorAll()
here?My app has far too many components and I will reduce the number significantly, so this performance problem will get solved in another way, but maybe this could help improve performance of other cases. It is just an idea that I thought may be easy to implement. Don't hesitate to dismiss it if I am wrong or if you think it's not worth the hassle.
Edit: I think I am wrong with my assumption that the result of
querySelectorAll()
can be cached, but if this is a performance issue that others see, too, it may be worth thinking about storing thedata-v-owner
relations in more performant way.Beta Was this translation helpful? Give feedback.
All reactions