PavelBlend / blender-molecular

molecular addon for blender
26 stars 7 forks source link

used less than 12% of cpu as Cython #8

Closed OmidGhotbi closed 5 months ago

OmidGhotbi commented 6 months ago

used less than 12% of CPU as Cython

PavelBlend commented 6 months ago

I don't currently have much experience programming in C. So I can't say for sure why the addon uses so little CPU capacity. The molecular core is practically the first program I wrote in C. Therefore, this problem will not be solved quickly. My idea is to rewrite the addon in the future so that it does not depend on blender's particle and collision system. This will allow you to export particles once, at the beginning of the simulation, and then perform all calculations in the C core, without importing/exporting data from/to Python. Perhaps this will solve the problem of low performance.

OmidGhotbi commented 6 months ago

great idea. because it may be the issue with GIL lock in python. so naturally if you offload all the simulation one c it will bypass the GIL lock as well.