Potential performance enhancement when purging materials

I’m working on a SketchUp-imported file with a lot of meshes and a lot of unused materials. Purge command on that file occupys high CPU and takes a very long time.

After some investigation, it looks like Rhino was iterating over the object table again and again whenever requested to delete a material, even in a Purge context.

Could this issue get improved, or was Rhino just adjusting the material index stored in every object’s attributes? I thought the in-file index is only calculated when the 3dm file is being saved.

Anyway, it would be better if Purge can provide a progress indicator.