Performance testing


Is there a way to encapsulate different defintions in GH to see which one needs more processing?

Using clusters is not an option because they are “static”, cannot self-update.

Thanks for the reply @enssea.algerie

I have not even the tiniest clue what you said there.

Give a man a duck and he’ll eat for a day, teach a man to duck and he can avoid low-flying objects for the rest of his life.

1 Like

Delicate insulting, I didn’t expect that coming from you.

Anyways, that statement is wrong when talking about me and how I use knowledge.

“Request as an object”, I’m not a programmer I don’t know what he means by that. I cannot understand such terminology. I don’t code for a living. I’ve no idea what “requests” is he talking about what “clients”.
Both words could be used in many contexts.

The profiler in grasshopper is unreliable, every time you re-compute the canvas you get different results. This is why I’m asking for a way to figure out starting and ending of a calculation(hence “encapsulate”) using a specific algorithm (out of many algorithms - different components connected leading to the same result)

I’m not sorry for not speaking your “language”.

I was responding to @enssea.algerie but feel free to take it personally. I was thoroughly confused by both posts.

That’s fine, jargon is rarely intuitive or self-explanatory, however if you use words like “encapsulation” and “static” in a way that differs from their common meaning within programming it will confuse.

Since Grasshopper will try hard to only recompute those parts that have expired, times will differ from one solution to the next. Add to that the fact that the first time a component runs there’s an overhead as it must be compiled, and that garbage collections will occur at unpredictable moments, and that the OS will not allocate cycles to a process in a predictable or reliable manner, there will be a fair amount of noise in any attempt to measure the performance of an algorithm.

Grasshopper does keep records of the total time required for each solution (a coarse representation of this measure is printer in the statusbar) and you may be able to levarage this existing system.

I can’t help you with details today, I no longer have a real computer at home and I can’t see the gh code on an iPad.

So in theory, taking into account this noise, the more complex algorithms the better. Then the noise will be negligible compared to the time displayed.

Still though, how can I measure this for the whole algorithm, not the whole gh file (status bar shows it for the file)

Something like this?

Hi @gankeyu,


Can I get the same list "Ranking(Individual) but only for the “selected”?

Alternatively getting that list for grouped components?

Is this report available in the current Pancake build?

Can I get the same list "Ranking(Individual) but only for the “selected”?

Yes, it’s only for the selected.

Alternatively getting that list for grouped components?

Now the practice is, you select some components explicitly, and do the inspection. If I understand your question correctly, do you mean selecting a Grasshopper group instead of some components?

Is this report available in the current Pancake build?

No, the feature is in the nightly build. But it will be released quite soon. Should be in this weekend.

By the way, the feature just reads time data from GH profiler. So it’s less useful for self-updating component.

Great, thanks, keep up the good work.
I haven’t been using your tool, usually I prefer using ootb components or my own scripts but that may turn the tide.

Here’s a C# template for measuring the performance of a whole file. It runs twenty consecutive solutions and measures the total time it takes. This will include viewport and canvas redraw times.

You can make it more specific to certain components by not running a GH_Document.NewSolution(true), but by specifically expiring certain components you are interested in and then running GH_Document.NewSolution(false). (8.7 KB)

Thanks @DavidRutten,

That will do for now, I’ll arrange my definitions in different gh files and run this.

Do I understand this correctly, with the form you in fact lock the canvas. And by clicking on the button you allow it to continue and count the time before 20 cycles complete and get back to this form?

Everything runs on the UI thread, so the locking isn’t so much a feature as an inevitability. It just happens, because I prevent any messages from being handled by continuously running code in a tight loop.

Performance report of 124 object(s):
PancakeDev is required for detailed timing and monitoring.
Computation time of the selected:
Computation time of the document:
    11 times
Bottleneck (individual):
    98.89% 0:00:00:00.4660076 (-34.84% ~ +30.47%) Brep | Plane
    00.55% 0:00:00:00.0025779 (-14.38% ~ +45.33%) Trimzero
    00.07% 0:00:00:00.0003161 (-05.21% ~ +14.79%) StripMeshToBRep
    00.06% 0:00:00:00.0002953 (-11.48% ~ +48.67%) Curvature
    00.04% 0:00:00:00.0001777 (-11.86% ~ +49.49%) Angle
    00.03% 0:00:00:00.0001258 (-14.02% ~ +57.81%) Pick'n'Choose
    00.02% 0:00:00:00.0000983 (-42.71% ~ +51.53%) Shatter
    00.02% 0:00:00:00.0000918 (-09.00% ~ +29.26%) Orient
Bottleneck (grouped):
    98.89% 0:00:00:00.4660076 Brep | Plane
    00.63% 0:00:00:00.0029633 Trimzero
    00.06% 0:00:00:00.0002953 Curvature
    00.04% 0:00:00:00.0001882 Pick'n'Choose
    00.04% 0:00:00:00.0001777 Angle
    00.02% 0:00:00:00.0000983 Shatter
    00.02% 0:00:00:00.0000918 Orient
    00.01% 0:00:00:00.0000700 Perp Frames
1 Like

Hi @gankeyu,

after installing Pancake now every time I want to shift+drag to inputs I get a context menu.
Could you please tell me how to stop this, and if possible make sure this is NOT the default behavior?

Pancake.gha (537 KB)

Shift+Click is changed to Ctrl+Shift+Click

1 Like

Thanks for the quick fix