Component takes longer than expected

Hi all, @DavidRutten,

I’m blind again without knowing what’s going on under the hood. I have a component that encapsulates a particle solver and if I measure what it takes on my own it is much less than the actual time it takes in GH and that show up on the profiler.

My measurement shows:

Component took 69 ms.
  BeforeSolveInstance took 0 ms.
  SolveInstance took 68 ms.
    Inputs took 4 ms.
    Solve took 58 ms.
    Outputs took 5 ms.
  AfterSolveInstance took 0 ms.
Stopwatch: 72 ms.

but in GH it takes 4.1 seconds!

For details, this is the component code. I have attached a normal stopwatch to prove that my custom nested stopwatch (RunningTime) it does not fail.

Something is happening to make such a big difference and I have no idea what it could be. Can someone shed some light so I can prove something?


Is the 4 seconds wrong, or are they happening somewhere where you’re not measuring?

And are those fancy wires, i.e. is there really only a single data item per input and a single component iteration?

They’re happening somewhere, the real time is about 4 seconds.

The component only run once, input data is one item per parameter.

Wow, this is so weird. I tried to run it without the debugging session of Visual Studio, that is, how this would run using it normally, and it works as expected, without delays. Does this give you any clues as to what might be going on?