Dynamo icon indicating copy to clipboard operation
Dynamo copied to clipboard

DynamoModel startup time improvements

Open dimven-adsk opened this issue 6 months ago • 0 comments

Purpose

This PR focuses on the DynamoModel startup performance, specifically when running under Revit and with the 10 most popular packages installed. These modified code paths are not as critical under Dynamo core because they are not visited as often.

Snapshot of the current performance:

devenv_AO7R6bTqDR

Proposed changes:

devenv_rCDMplDzBr

  • we can cache the assembly reflection calls instead of calling them for every single node definition documentation
  • we can remove or reduce the linq calls because they exacerbate hot paths
  • we can avoid concatenating three or more strings with the + operator, because that creates unnecessary calls

These changes do not change the underlying logic but can improve the model startup performance by 4~5%.

Declarations

Check these if you believe they are true

  • [ ] The codebase is in a better state after this PR
  • [ ] Is documented according to the standards
  • [ ] The level of testing this PR includes is appropriate
  • [ ] User facing strings, if any, are extracted into *.resx files
  • [x] 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
  • [ ] 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) Reviewer 1 (If possible, assign the Reviewer for the PR)

(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

dimven-adsk avatar May 21 '25 15:05 dimven-adsk