@icehuli said:
I guess the bottleneck is the drawing operations in SU.
Do some benchmarking to determine for sure where the majority of the time is spent. Optimizing stuff without know it's the actual bottleneck might just waste you a lot of time, especially when the alternative you consider is using the C API.
I've had big speed improvement by learning how Ruby works. What the bottlenecks in the Ruby API is - such as creating objects and string manipulations etc.
Cache calculation and using Hash lookups can often get you there in a big way.
However, if you do a lot of calculation, then you might want to do some work in C. I made a Ruby C Extension to calculate the soft selection radius in Vertex Tools - it made for hounded of times of speed improvements.
How much gain the C API gives, I'm not sure. I've not used it yet, but I'm very curious and I have been meaning to try exactly what you propose. But I'm not sure if the overhead of writing to file and loading will give much benefit. So if you go this route I'm very curious to hear your results. But do make sure you have identified your bottlenecks. Note that the Ruby API and C API both calls the same core SketchUp functions - so it might be that it's the SketchUp core itself that's the bottleneck.




