Skip to content
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

make less id calls #10

Open
wants to merge 1 commit into
base: reope/performance-base
Choose a base branch
from

Conversation

dimven-adsk
Copy link
Owner

@dimven-adsk dimven-adsk commented Sep 26, 2024

List of Affected Nodes/Modules

All nodes that wrap or create Revit elements

Current Performance

Every time an element is wrapped, we store its id and unique id. Then the native element is passed to the element binder and the id and unique id properties are fetched again. It didn't make sense to me to pay the cost of fetching those twice after already referencing them (plus also allocating the memory):

devenv_yxJHtQs9CG

Proposed Performance

We should not pass the native element but the already extracted id and unique ids:

8tJoXZEI27

The cost is mostly from fetching the unique id/ Unfortunately, the performance benefit did not quite pan out the way I expected it to (should have reduced the get_UniqueId total cpu time by at least half)

Dynamo Tuneup Comparison

With a very basic graph that fetches 25k elements and creates 10k instances the performance gain is negligible and we go from 4.7 seconds on average down to 4.6:

Revit_LovGNJkCAB-base

Revit_4Qptcy6dOL-change

Overall I am not entirely sure if this change is worth it due to the large code change.

Checklist

  • There are no public function signature changes
  • Any public code that is no longer in use is tagged as obsolete and preserved.
  • The code changes have been documented
  • The overall behavior does not change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant