You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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:
Opening a new file, which also adds it to the recent files will now not refresh the complete list, deserialize and add only the new item.
In case when adding to the list, increase the size of the recent files list beyond the maximum allowed recent files, it will trigger another refresh of the complete list, which is not mitigated by only removing the affected item from the list.
When an existing item is selected from the recent files list, simply move the location of that item, to the start of the list, instead of yet again refreshing the complete list.
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.
Name
Size
Time
PointSq
21 KB
4 ms
Test1
8 KB
1 ms
Autodesk-MaRS-office-example-v3
1372 KB
151 ms
Column_Builder_Grid
79 KB
4ms
Manekin
3100 KB
311 ms
Manekin
3100 KB
280 ms
Manekin
3100 KB
348 ms
Manekin
3100 KB
219 ms
Manekin
3100 KB
341 ms
Time taken to deserialize all files: 1721ms
(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
@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?
@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.
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.
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.
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
*.resx
filesRelease Notes
Reviewers
@DynamoDS/eidos