Thinking Particles performance Python vs C++

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 21/04/2012 at 09:14, xxxxxxxx wrote:

I was wondering whether someone had any experience in the kind of performance difference that could be gained by moving a TP heavy plugin from Python to C++? The most time consuming thing is a loop over lets say something like 200k particles that sets each particles attributes. In Python this will take something like 3 seconds - if the C++ SetPosition, SetXXXX.... functions are a lot better optimized, I'd consider porting my plugin there, but since that would take a lot of time, I'd prefer to make sure it's worth the effort. So... any experiences with this here?

Michael

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 22/04/2012 at 11:31, xxxxxxxx wrote:

Hi, the speed to allocate particles is the same because there is very little overhead here to the pure C++ calls. But when you set/get the attributes of 200k particles in a loop you will get a noticeable speedup when switchting to C++ here. From my guess a speedup of two or three - for sure this depends on the case.

Cheers, Sebastian

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 22/04/2012 at 18:22, xxxxxxxx wrote:

Hi Sebastian,

I've started implementing it in C++ and indeed the speed increase is very noticeable. I'm running into two issues though: how do you read out the "Max Particles" setting, since without I seem to crash Cinema once the number of particles hits that number, and the second: what's the best way to empty a Particle group without deleting the group itself? In Python I used the GetParticles() function and looped through the list, however that does not exist in the SDK it seems? What's the most efficient here?

Thanks
Michael