Q: When running a populating script why is frame rate so slow? (Related to Holomark3)

Hi guys,
I have a question that I still don’t get. Why is Rhino so very slow at running this script?

import rhinoscriptsyntax as rs
import random

for i in range(20):
    for ii in range(20):
        n=random.random()
        rs.AddPoint(i,ii,n)

Rhino populates slowly one-by-one for a while then jumps to the end all done, in about 5 seconds.
If I add rs.EnableRedraw(False) to it then it takes just 0.09 seconds.

AND if I add a rs.Redraw() in there then it take a whopping 40 seconds!

import rhinoscriptsyntax as rs
import random
import time

time1=time.time()

rs.EnableRedraw(False)

for i in range(20):
    for ii in range(20):
        n=random.random()
        rs.AddPoint(i,ii,n)
        rs.Redraw()

rs.EnableRedraw(True)

print time.time()-time1

So why doesn’t it take just over 0.1 seconds to redraw each new point?

Hi Jorgen,

my understanding is Redraw not only redraws vports but also some UI, so this could be a slowdown.
Dale recently added a switch in RhinoScript redraw that affects vports only, and it was a huge speed up.
I am sure RhinoCommon has some equivalent to this “light” redraw…

1 Like

Ok, that might explain why running rs.ViewSpeedTest() 100 times with 1 frame intervals is much faster than rs.RotateView() 100 times.

Hmm, that is actually weird.
The Enableredraw is a slowdown, and “old” redraw.
If you are not using any of these, the speed of both methods you mention above should be the same…