I am coming to you with a question regarding the performance speed of c# components in grasshopper. I am creating a calculation-heavy component within the c# component in grasshopper and have stumbled upon something strange when profiling it; while the integrated GH profiler measures an average iteration time of approx 300-500 ms, when I profile the code within with stopwatch it comes out at about 50-100 ms, a drastic decrease. This measurement does not include the “additional code” space at the end of the c# component, where I mostly save certain data into memory. My question is what could be causing this difference in measured speed and could it be because of the last part of the code containing data saved in memory? Additionally, can I expect a performance increase by shifting the code into a custom-made component / plug-in in VS?
Thanks a lot for any help!