Closed Vorror closed 9 years ago
To be honest, I highly doubt the accuracy of this methodology, because Chrome's timeline profiling and memory snapshots show inconsistent results. When using the timeline profiler to record node counts, it shows that node counts are increasing, however when I try to identify the "leak" by comparing memory snapshots, there are no DOM leaks found.
The author of drool actually opened an issue about this long time ago, and you can see my comment here: https://github.com/tastejs/todomvc/issues/1354#issuecomment-115070749
And also see Paul Irish's comment here: https://github.com/tastejs/todomvc/issues/1354#issuecomment-133798434 - basically what he is saying is that these "forced garbage sweeps" may not always clean nodes that are in fact already detached.
The only way to track down Node leaks is using the memory snapshots comparison - and when I do so on the TodoMVC app using latest 1.0 beta, the snapshots diffs are so clean there's nothing to even look at:
To me the only reasonable explanation is that the snapshots force a cleaner GC than other profiling mechanisms, and it's beyond my control if someone tells me Vue has DOM leaks because they are testing it using a profiling mechanism that can only tell you "there are leaks!!!" but cannot tell you where the leaks are coming from.
Thanks for clarifying!
I stumbled across an interesting library called drool, which basically finds dom leaks and ran the vuejs todo app through it. And these were the results:
code used:
I don't know if this is implementation issue in the library itself or the how the todo app was written. It may also be worthwhile to add this to the ci build? Since I see a few other frameworks doing it.