Message 1 of 6
C++ performance surprise
Not applicable
09-30-2018
01:00 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi again, I was trying to overcome some performance issues I have with a tool I'm developing. The main tool is in python and I thought that c++ would be the right choice at least for the most costly process. Iterate for the selected nodes in a given time range. So I did and expose the function to maxscript. To my dismay I didn't aprecciate significance performance improvement. Some how the action of setting an transformation matrix in a given times keep being extremely slow whe you have to do it in a nested loop iteration. I don't know if anyone can share another aproach or method that could be faster.
This is an snippet to test performance just assigning and identity matrix to every node.
void NoMagic::do_something()
{
int n = GetCOREInterface()->GetSelNodeCount();
Matrix3 f(1);
for (int frame = 0; frame < 100; frame++)
{
TimeValue t = frame * 160;
for (int i = 0; i < n; i++)
{
INode *node = GetCOREInterface()->GetSelNode(i);
node->SetNodeTM(t, f);
}
}