Large Project - Dynamo Performance

Dear Experts,
What kind of practice to apply in order to get faster performance through dynamo tasks at the large projects.
As an option i tried to use workset function. However realized that all elements (closed workset elements as well) still showing in the dynamo and trying to handle them as well leading very bad performance.
Your expert suggestion will be highly appreciated.

More elements will always take longer than less, no way to avoid that really.

Collect minimum number of elements (e.g. avoid getting all elements in active view and then filtering it down). As well as this explore python and filtered element collectors, you can sometimes collect elements quite efficiently using these versus using heaps of nodes to achieve the same outcome.

3 Likes

Use TuneUp package. You’ll get many thoughts. Divide things you cant change(revit iteraction) and others. Post specific quetstions here, we’ll help.

2 Likes

Dear Vladimir, Please find screenshots of results:

  • We have 30283 elements
  • List.SortbyKey takes 4504 (75 min) sec to make its job :frowning:


Well one thing I think could speed you up would be to create a dictionary from from your code block and just look for a single item. Right now you are potentially iterating items 20+ times when you just need a single value.

I would also say that the GetParam node before that could just be the OOTB unless you at jumping between Types / Instance params. It could simplify the List / Dictionary creation and processing.

Also, it is hard to tell from the small portion of your graph, but there are several different groupings that are taking a long time. See if you can arrange / use those in series so your not duplicating that process multiple times on the same data set.

3 Likes

100% this. I would not use the TypeOrInstance node from rhythm if you know what kind of parameter you want. Because that performs a search of both parameter types (type and instance).

The node Element.GetParameterValueByNameTypeOrInstance was meant as more of an exploratory node for when you aren’t completely sure what kind of parameter you are wanting to get at. I would not recommend using it when you can easily find out what kind of parameter you should be targeting

4 Likes

@kvusal

Try Group by Key at first. (you just breaking sorted 30000 items with grouping).
Than sort list of groups with sorted group keys. Or better create and use dictionary. It can speed up things a lot.

If System Abbreviation is Bult-in parameter, try to use Bultin parameters nodes from Archilab package.
Avoid Index of, List.Combine. Try to use simple [a,b].

Dear experts,
Many thanks for answers.
Took long time to test your recomendations and give feedback. Unfortunatly, still no any acceptable result yet.
So decided to start learning python or c#.
Do you have any recomendation of software language for large project. (Especially Task is: to sort 100000 of elements.)
Python or C#. Which one is faster?

C# has the potential to be much faster, developed as an add-in ideally. Python can undertake tasks quicker than Dynamo nodes sometimes (e.g. iteration can be more effective versus levels/convoluted pathways). I typically recommend learning Python first as it is a softer introduction to object oriented programming versus C# in my opinion, and means you don’t have to learn Visual Studio immediately also.

1 Like

Although I do agree with @GavinCrump that python can be substantially faster when used compared to OOTB/ packaged scenarios, I would argue more for learning C# and using an IDE like Visual Studio, Rider, or SharpDevslop. My main reasoning for this is that once you know the C# it’s very easy to transition back to Python because you’ll better understand the castings, but going from python to C# can be more challenging when variables need to be explicitly typed.

Realistically, knowing both is the best way to go as some tasks will be suited better for one over the other, but overall my opinion, based on the path I took to get here, is that after really harnessing C#, python in Dynamo is generally very easy and I default to it nearly 100% of the time regardless of whether a packaged node exists or not. And, also now compiling direct add-ins and other software is also very fast because of C# knowledge. I am by no means a professional dev, so take my opinion as you will, but I get around VS, add-ins and Dynamo pretty quickly and it’s mostly due to the fact I jumped ship to C# and then came back.

5 Likes

Well, can you give us an example? Huge times, smth. wrong. Maybe with Dynamo integrity on your PC.

The same problem I mentioned before at March 23 in these conversations. You can see screenshot at that post. Each List.SortByKey operation tooks app. 30-75 min.

Need your RVT file for test.