-
Notifications
You must be signed in to change notification settings - Fork 8
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
Fix performance issue with the vue-utilities v-mousetrap #43
Comments
This turned out not to be an issue with See the linked |
@BryonLewis I wonder if you ever encountered this issue in Otherwise, I plan to merge #46 here soon, as it has resolved the issue with unbounded growth of listener count in |
I haven't seen this but it could be a result in the way that mousetrap works and the way we've implemented it. I'm wondering if some elements aren't properly calling unbind and are being abandoned and still connected.
I did that on viame-web to check and see how many items are being bound and unbound. I loaded multiple datasets and switched between them and at most I had 12-13 bound depending on what dialogs were open. We even have a unique case were we present a list of tracks in the side that could be 2000K items long but it uses a virtual scrollbox so only 10 are visible at a time and it was properly binding and unbinding the values. https://github.com/VIAME/VIAME-Web/blob/master/client/viame-web-common/vue-utilities/v-mousetrap/index.js I wish I could be more help immediately but my first guess is to confirm that these items are calling the unbind directive when they are removed. It could very well be something with mousetrap as well. |
To be certain it's not a failure to call If you're noticing a lot of calls to I looked at your If you look at the issue and fix on the Thanks for taking the time to have a look at this @BryonLewis, I really appreciate it 😁 |
Thanks for the explanation, I was looking at the event Listener tool and didn't notice the 'reload' icon. Now that I'm actually using the reload button I can see the same exact thing happening when scrolling though those lists. Although it's interesting if I decide to iterate through all of the DOM nodes using: https://developers.google.com/web/tools/chrome-devtools/console/utilities#geteventlisteners I haven't read the mousetrap stuff but I imagine they are having some issues with garbage collection of the events so while unbound they are remaining in memory. |
Fixed by #46. |
MIQA uses
v-mousetrap
fromvue-utilities
, and actually moved that library code into the application since it's no longer being maintained at its previous home.Debugging performance degradation over many experiment loads, I discovered over 100K listeners bound to the DOM, most of which were created by `v-mousetrap. In this branch commit, I experimented with just removing the use of that library, and the number of listeners stopped growing without bound, and experiment loading performance was greatly enhanced.
However, key bindings are an important feature in the application, so we need to either fix
v-mousetrap
, or else replace it with something else.The text was updated successfully, but these errors were encountered: