Friday, March 20, 2009

Automatically propagation much faster

In the last days I've faced a hard to find bug as most of the functionality seems to be correct therefore it was harder to check, as the single symptom was that the things went from slow to much slower.

The problem was that every time before a function to execute, the function checks the dependencies of it and registers (in a bogus way) to them again. In the result, the more you use it the more the function will be called. In case of using multiple dependency functions as: a rectangle is the base of extrude, makes like: 9 x 7 calls, which makes the extrude to be executed for 63 times, at the second call was like 10 x 8 = 80 times, etc.

Right now the extra calls may happen from a user’s code, like not using the BeginUpdate method. This will call a function at every dependency change. But this is a usage problem, not a Naro API problem.

I will use right now the power of Naro API to update the tree automatically on the basis of tree changes and to show the references of every shape, as a child of this shape.

No comments: