Dynamo
Dynamo copied to clipboard
Improve startup and opening times by speeding up changes to recent files
Purpose
Imagine you have 10 very large graphs in your recent files list. Every time the start page opens, it reads the entire contents of those files (plus any backup files), and then parses the content of each file twice! Then every time you open a new file, the whole process is repeated multiple times 😿
I propose we:
- Stream the files instead of reading their entire content.
- Skip the json validation (which forces us to pre-parse the file). It's not important why the file fails - Dynamo shouldn't be a json parser, just a json consumer. If the file is not a json or if the json content is malformed, you should use the right tool to figure that out.
- Read and store only the properties that are actually needed.
- Inline the description, author, etc. methods because they're not really needed.
- Implement a "quiet" observable collection for the recent files list. When you open a file, it is (1) removed from the list, (2), added to the front of the list, (3) if the max number of recents is exceeded, the list is truncated. These multiple actions force the start page to read the recents' properties multiple number of times.
The way the RecentFiles is used right now doesn't really necessitate an ObservableCollection and a list property would work just the same. However, in case that changes in the future, a quiet observable collection will preserve the flexibility.
Declarations
Check these if you believe they are true
- [x] The codebase is in a better state after this PR
- [x] Is documented according to the standards
- [ ] The level of testing this PR includes is appropriate
- [ ] User facing strings, if any, are extracted into
*.resxfiles - [ ] All tests pass using the self-service CI.
- [ ] Snapshot of UI changes, if any.
- [ ] Changes to the API follow Semantic Versioning and are documented in the API Changes document.
- [ ] This PR modifies some build requirements and the readme is updated
- [x] This PR contains no files larger than 50 MB
Release Notes
(FILL ME IN) Brief description of the fix / enhancement. Use N/A to indicate that the changes in this pull request do not apply to Release Notes. Mandatory section
Reviewers
(FILL ME IN) @mjkkirschner
(FILL ME IN, optional) Any additional notes to reviewers or testers.
FYIs
(FILL ME IN, Optional) Names of anyone else you wish to be notified of