On 18/07/2018 at 02:58, xxxxxxxx wrote:
Hi xfon5168, thanks for writing us.
With regard to your question, the performance increase you're actually benefiting is, in large part, caused by the Python call layer being skipped. The design of the code and the functions used are pretty likely the same of your Python script which means that the business logic is exactly the same.
A few notes though:
- why are you calling WeightDirty twice in the for loop? Calling it at the end of the for-loop could be more efficient with, maybe, no side effects on the delivered functionality;
- move the counter definition outside of the for-loop definition.
Last but not least, without a proper time-logging of the different execution calls of your code, could be really argue to propose an optimal solution even considering the presence of multiple FindXXX and SearchXXX calls.