Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New cahce system. #15

Open
OmidGhotbi opened this issue Apr 15, 2024 · 3 comments
Open

New cahce system. #15

OmidGhotbi opened this issue Apr 15, 2024 · 3 comments

Comments

@OmidGhotbi
Copy link

Make a new cache system independent from the blender cache, and add dedicated thread for the cache system.

@PavelBlend
Copy link
Owner

Describe in more detail what the new cache means? My cache already does not depend on the blender cache.
01
02

@OmidGhotbi
Copy link
Author

yes, this is good, if we write the cache inside C code and do not load it at all in Blender or just every few frames it can heavily affect the performance of the code. because at the moment it calculates every single substep for import, export, and load data, and as I can see it will take about 30% of all processing time. if we do all substeps and then just update the viewport at the end of it like what you did in writing the cache we can improve the code massively.
the reason it will help is GIL lock in Python every time that code reports or gets back to Python need to slow down and respect the GIL lock. less data transfer more speed.

@OmidGhotbi
Copy link
Author

The only way we can achieve best performance is to save data in the background without using any kind of sending and receiving data in a blender, and complete the detached task, in blender we check if the cache is available for a frame load it if not just skip until it's ready. in this way we can get 95% of CPU to work on the simulation not most of it on blender and just leave small pice on CPU not even a core or thread, the natural idle process for blender UI and loading the cache separately.
i know it is hard because the current code needs blender particles and collision, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants