[Rhino8] Purge() Object Freezes Rhino if a single object is selected

Strange one for you - Purging Objects - can Freeze Rhino - but only if you have an object selected.

I can replicate this on two differently specified windows 11 PC’s but not on a 3rd.

Notice the 5 second lag the second time the script is run below!

PurgeBug

This is a toy example but the real issue is causing up to 10minute freezes on our CNC machines & preventing our recommending an upgrade to Rhino 8 to customers.

To reproduce

  1. Open new Document
  2. Run Script
  3. Notice times are very close together
  4. Draw a rectangle
  5. Select Rectangle
  6. Run Script
  7. Notice Significant Freeze and gap between times
using System;
using Rhino;
using System.Linq;
using Rhino.Geometry;
using Rhino.DocObjects;

var doc = RhinoDoc.ActiveDoc;

// create / find reference layer
int layerId = doc.Layers.FindName("Ref")?.Index ??  doc.Layers.AddReferenceLayer(new Layer {	Name = "Ref"}); 
var layer = doc.Layers.FindIndex(layerId);

// add reference objects
for (int i = 0; i < 1000; i++)
{
        var circle = new Circle(50).ToNurbsCurve();
        doc.Objects.Add(circle,new ObjectAttributes {LayerIndex = layerId});    
}

Console.WriteLine("Created "+ DateTime.Now.ToString("hh.mm.ss.ffffff"));

// delete them
doc.Objects.FindByLayer(layer)?.All(doc.Objects.Purge);

Console.WriteLine("Deleted " +DateTime.Now.ToString("hh.mm.ss.ffffff"));

SysInfo_Occurs.txt (2.3 KB)
SysInfo_DoesNotOccur.txt (2.4 KB)

We updated the Nvidia driver on one affected machine and the slowdown running the above script with a rectangle selected went from a 5 second to 40 seconds (!)
SysInfo_Occurs_Driver_Update.txt (2.3 KB)

Hi @david.birch.uk,

I will try to look at this later this week.

Thanks,

– Dale

Hi @david.birch.uk,

Your script seems fast here on my 3 year old Dell laptop - between 13 and 16 milliseconds. No freeze ups or lags.

– Dale

Thanks @dale

Same on my Dev PC, but this is occuring on several customer PC’s

Lag only occurs if objects are selected.

Anyone else able to replicate? Just open a new document & c# script editor, paste above and record times.

David

Hi @david.birch.uk ,
I have tried it and I can’t reproduce it either.

Could you please send us information about the computers on which it is not working properly? Please check that they have the latest service version of Rhino 8 installed and that Windows has all updates installed.

1 Like

Thank you @Guillermo_Varela & @dale

I can confirm this problem was resolved in Rhion 8.6 - I am no longer able to replicate it on the problematic machines. :slight_smile:

Good afternoon,

I am able to recreate the same issue using the same steps

This is my current system info:
SystemInfo.txt (2.3 KB)

This issue is occurring in 8.7 for us unfortunately.
I suspect it specific to the GPU in question a Geforce GTX 1650

Hello David
Can you try to disable all Plug-ins that do not ship with Rhino , using the plug-in manager, and re-test?
The system’s video card is not the issue as the script never redraws the screen.
Thanks

Hi @cecile unfortunately we are still seeing the same slowdown with no plugins loaded.


sysinfo (2).txt (2.2 KB)

DavidBirch2.cs (1.5 KB)

Hi @david.birch.uk , please download and test this slightly modified version.
Let us know if that works.

Thank you @Guillermo_Varela i have tested this today on 8SR8 & SR9 with both your script and mine. I am unable to replicate the issue. Your script reliably runs in 3-4ms regardless of whether anything is selected.

I note with interest that there was a NVidia driver update installed on the machine on June 12th so i suspect this resolved this issue.

Will report if this crops up again.