-
Notifications
You must be signed in to change notification settings - Fork 668
DYN-8797: Optimize AddToRecent files #16197
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-8797
|
@zeusongit, not sure about the history here, but I see that there are a number of other changes in the original PR from the contractors. It's vastly different from this PR. Was it decided not to go ahead with those changes and move forward with this PR instead? |
Hey @aparajit-pratap, yes I did mention that in the description; there was another part of the PR by Reope, that deals with deserialization optimization for graphs, it will be addressed in a separate PR, as that requires more discussion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR optimizes the way recent files are managed in Dynamo by reducing unnecessary full list refreshes when only a subset of changes occur. Key changes include:
- Replacing the PreferencesViewModel’s local UpdateRecentFiles call with dynamoViewModel.UpdateRecentFiles.
- Switching from ObservableCollection to SmartObservableCollection for recent files and adding move logic for existing items.
- Enhancing the StartPage handling to differentiate between full refreshes and partial list updates on collection changes.
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/DynamoCoreWpf/ViewModels/Menu/PreferencesViewModel.cs | Uses dynamoViewModel.UpdateRecentFiles and removes redundant local method. |
| src/DynamoCoreWpf/ViewModels/Core/DynamoViewModel.cs | Switches to SmartObservableCollection and refines the AddToRecentFiles logic with inline documentation. |
| src/DynamoCoreWpf/Controls/StartPage.xaml.cs | Adjusts recent files refresh behavior based on the type of collection change event, with support for full refreshes via a new flag. |
Files not reviewed (1)
- src/DynamoCoreWpf/PublicAPI.Unshipped.txt: Language not supported
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
reddyashish
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Purpose
Based on #15759
The PR optimizes the way we load recent files, earlier we used to refresh the complete list of recent files, when launching dynamo, and then again when opening a graph, this was mainly done to fetch graph properties like thumbnail, description etc., to be displayed on the start page.
The optimization include handling events such as:
There was another part of the PR by Reope, that deals with deserialization optimization for graphs, it will be addressed in a separate PR, as that requires more discussion.
Results:
Results depend on the user's list of recent files, if the user has bigger files it will take longer. For this example I tested with 5 big and 5 "normal" size files.
(Total Time: 1721ms)
Before:
Action: Load Dynamo and Open any graph - Total time x2
Action: Load Dynamo and Open any graph (when recent files list at max items) - Total time x3
After:
Action: Load Dynamo and Open any graph - Total time x1
Action: Load Dynamo and Open any graph (when recent files list at max items) - Total time x1
Declarations
Check these if you believe they are true
*.resxfilesRelease Notes
Reviewers
@DynamoDS/eidos