Grasshopper Frame Rate

Hi,

Is there a way, some hidden option, to show the frame rate on the canvas?

View \rightarrow Canvas Redraw Speed.

It isn’t technically a framerate since GDI+ is redraw-on-demand, meaning the time between canvas draw operations may be minutes or even hours if nobody is invalidating it.

Also note that the measured latency may well exceed the refresh rate of the screen. A simple file has a draw latency of about 10ms on my machine whereas my monitor refresh speed is 16ms. These excessive speeds are to be taken with a bit of salt as a lot of steps in the process are skipped if they cannot be drawn to a device anyway.

1 Like

I can still use it to see the effect of wires on my framerate, right? If I don’t touch this “invalidating” through scripts. (not that I know how :smiley: )

Grasshopper.Instances.InvalidateCanvas.

Any solution causes the canvas to redraw. Also all mouse clicks and mouse moves cause a refresh. Window resizes too.

Window resize makes sense but mouse move and click. How come?

If you’re not dragging and creating a multi-select (click+drag).

Update: seems like GH canvas works like a game_loop :slight_smile: constantly calculating cursor position.

Is this the reason why you lock GH when popping up System.Drawing gui objects? If it isn’t locked you’ll get constant popup of windows until OutOfMemory, right? :stuck_out_tongue:

Better to cause a needless update once in a while than to not update when it should.
Technically objects could choose to draw themselves differently depending on mouse cursor position so I thought it prudent that every mouse event invalidates the canvas.

There’s events I get whenever the mouse button state or coordinate changes. These come from the underlying winforms framework. Internally that framework may well run a loop checking the mouse state over and over again, but it doesn’t raise events if the state doesn’t change.