-
Notifications
You must be signed in to change notification settings - Fork 326
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
Switching between documents slow #142
Comments
More info - simply clicking on tab header (with document name and close button) is enough to freeze everything. How long it will stay unresponsive is directly related to number of child controls or UIElements. |
Hi, thanks for sharing these details. It sounds like you are having trouble with the number of UI Elements that can be handled with WPF. I encountered and described a similar problem in a related CodeProject article: Space Navigator A Journey into WPFs Display Sub System. In an ideal world we should off course be able to update a
Its at least extremelly difficult to fix this in AvalonDock without breaking something else (like updating the UI under some exotic condition).
What do you think about optimizing your document? Have you tested this with:
If yes, and you find that your freezing dissappears it could really be worthwhile looking into 1). |
Thank you for your reply - I have more information that should help. I've changed number of elements inside canvas - how long it will take to switch documents depends on number of canvas elements - currently, with 8k switching takes second-two and it increases with number of elements inside canvas. Issue is, all other operations (minimize, resize, open outside AvalonDock (inside normal window) are not impacted by number of canvas elements that severely. But i discovered something else: For some reason, LayoutDocumentPaneGroup has 16+ million child objects and they all are of type LayoutDocumentPane. I have only about 8k elements in Canvas (one of Documents inside dock panel) but for sure I didn't load 16+ million object. I guess its some kind of error which occurred while I was moving/docking document. See attached image [edit] - additional details |
After much tinkering, initial problem of slow switching is solved by "virtualizing" tab control which is responsible for hosting documents. I've used following solution https://stackoverflow.com/a/37171847/1286216 and changed Also, it should be added as an option of DockingManager whether to use virtualized tab control or not, since some people might not like it. Anyway, I'm closing this issue and thank you @Dirkster99 for assisting in rubber ducky programming. Time after time, it proves its invaluable for solving issues. |
Hi, it looks like you discovered 2 issues - the issue with the PropertyChanged might be a memory leak that occurs during switching/re-ordering tabs. I've already tried to close some of these issues: but there might be more and its really hard to solve some of these because a solution might cause another side effect leading to another bug :-( which is why I had to roll-back part of the above fixes in this commit Undoing LayoutGridControl changes commited on 2020-02-22 . A pull request with GitHub is really easy and can be done through the web site and VS only:
Verify the branches shown and click Pull-Request: Use the next dialog to describe your changes in a human-readable format and click Create pull request to make the PR visible under Pull Requests in Dirkster99/AvalonDock: This lengthy explanation makes it seem difficult but its really simple since you can do it all with the web interface and VS and I just tried to describe/screenshot all details hopping that its easy to follow. Please let me know if you have additional questions or a contribution :-) |
Thank you very much for those instructions, I'll try to push this change as soon as I test everything. Again, option should be added later on to disable this behavior if someone still wants to controls/documents be unloaded (removed from Visual tree) and loaded again when switched back to that document. Performance is much better now (switching is almost instant) but memory leak is another issue someone more experienced should tackle. |
Hi,
I'm having an issue with
LayoutDocument
insideLayoutDocumentPane
. When I add multipleLayoutDocument
s inside the DocumentPane and if content of that LayoutDocuments has many UIElements (for example, tens of thousands of elements) switching between them is extremely slow - it seems that when clicked/switched to,LayoutDocument
recalculates something with it's child controls, includingCanvas
. Switching is super fast if hosted controls insideLayoutDocument
are simple, with normal number of child items.Also, docking from floating position back to "pinned" state also sometimes takes long time, same like switching between documents like above.
Any way to bypass this behavior? Users will have 10-15 documents open like that in "tabs" so switching between them should be fast.
The text was updated successfully, but these errors were encountered: