I’m porting a Python Spline Solver to C++. My FPS went from 25 to 39, which is a bit disappointing.
I’m currently using std::vector to store my data because it’s easier to work with. Would switching everything back to Maya’s native MDoubleArray or MPointArray give me a significant speed boost?
Or am I looking for performance in the wrong place?
If you’re passing the data to Maya functions or writing to array attributes, working with Maya native types is a bit easier because you don’t need to do any type conversions.
But otherwise it basically doesn’t matter, just make sure you are using std::vector::reserve() when you create it.
Otherwise, poor performance is about how much work you’re asking the CPU to do. Your algorithm is more important than which data structures you use. To get a good idea of what’s slow without just guessing, you’ll have to profile it.