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

Fetching Parameters By Name #1

Open
wants to merge 2 commits into
base: reope/performance-base
Choose a base branch
from

Conversation

dimven-adsk
Copy link
Owner

@dimven-adsk dimven-adsk commented Aug 14, 2024

(moved from DynamoDS#3085)

List of Affected Nodes/Modules

Element.GetParameterByName
Element.SetParameterByName

Current Performance

There is a two-fold penalty with the current method. The first one is because every single parameter is fetched for every element and the second is because the entire definition is fetched for each of the parameters in the resulting sequence when all we need is the parameter's name

devenv_qRNt6WqQKC

Proposed Performance

Both of these can be avoided by using the GetParameters(string) method instead. That way fetching the definition is completely avoided and the parameter filtering happens in the native side.

devenv_oxm0oEVlf8

Dynamo Tuneup Comparison

On a model with ~55k elements fetching a single parameter value we drop form 14000ms to 6000ms

image

image

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

@@ -8,7 +8,7 @@
<TestOutputPath Condition=" '$(TestOutputPath)' == '' ">$(OutputPath)</TestOutputPath>
</PropertyGroup>
<PropertyGroup>
<REVITAPI Condition=" !Exists('$(REVITAPI)') ">$(SolutionDir)..\lib\Revit 2025\net8.0</REVITAPI>
<REVITAPI Condition=" !Exists('$(REVITAPI)') ">C:\Program Files\Autodesk\Revit 2025</REVITAPI>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, in the future can you, please, add an entry instead of replacing this one? The current path is used by the internal build pipeline to download Revit API. Just adding another with the current condition !Exist('$(REVITAPI)') should work just as well.

@dimven-adsk dimven-adsk changed the title Reope/performance parameters Fetching Parameters By Name Sep 4, 2024
@dimven-adsk dimven-adsk mentioned this pull request Oct 3, 2024
4 tasks
dimven-adsk pushed a commit that referenced this pull request Oct 3, 2024
dimven-adsk added a commit that referenced this pull request Oct 31, 2024
commit 8cc2f05
Author: DimitarVen <[email protected]>
Date:   Thu Oct 3 16:55:34 2024 +0300

    bring improvements from #1

commit e22f851
Author: DimitarVen <[email protected]>
Date:   Thu Oct 3 14:40:13 2024 +0300

    fix for parameter missing

commit 9933dc6
Author: DimitarVen <[email protected]>
Date:   Thu Oct 3 14:28:01 2024 +0300

    use internal element def

commit 30e8dfc
Author: DimitarVen <[email protected]>
Date:   Thu Oct 3 14:24:03 2024 +0300

    store definitions

    for the duration of the graph execution
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.

2 participants