I recently stumbled upon SimplifyModifier when I needed to dynamically reduce the face count of loaded geometries in my application.
In the end I rewrote the module completely to suit my needs. Part of this exercise resulted in an optimization of the collapsing code. I achieved >65% performance improvement overall.
So I decided to modify the original file and share the critical change. It is really minor - see lines 80 to 97.
I drive the collapsing of vertices with an array containing the desired number of lowest cost vertices to be removed.
Please note that my changes to the SimplifyModifier was somewhat naive.
Using a sorted array to drive the collapsing of vertices is a good way to remove the problem of exponential complexity . However, my implementation does not take into account the changing “collapseCost” as vertices are removed, and the impact of this grows worse as more vertices are chosen to be removed.
I intend to publish an update next week, once my current project is done. I believe the answer lies in making a more efficient data-structure to hold the vertex and face data.