Fix performance issues when opening many documents#1578
Merged
Conversation
SetAccelsForAction() is quite expensive (I suspect it needs to go through and update any widgets which might be using the action), so this should be done once up front rather than when rebuilding the menu. This improves the performance of opening 20 documents at once from 17s to 400ms Bug: #1574
Member
Author
|
When opening ~50 documents this still gets pretty slow (around 14s). It seems like it's still related to the document menu changing - disabling |
- Don't use WindowActions to change the active document. This is UI code, and the WorkspaceManager is the correct place to do this. Instead, WindowActions should just update its menu according to the workspace's events - Add an event which is fired before the active document is changed. This allows the tool manager to commit the current tool, decoupling the two - Use the active_document_index as the signal for whether there are open documents, since the document created event is fired before the document is activated - Remove the action manager parameter which is no longer needed
…e open This improves the performance of opening 50 documents from ~14s to 1.5s
Member
Author
|
With the latest changes I've got it down to around 1.5s to open 50 images, which is much more reasonable This will definitely need some more testing since it involved some larger changes to always use the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SetAccelsForAction()is quite expensive (I suspect it needs to go through and update any widgets which might be using the action), so this should be done once up front rather than when rebuilding the menu.This improves the performance of opening 20 documents at once from 17s to 400ms
Bug: #1574