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

parallel_for optimization in memory allocation #125

Open
aconstlink opened this issue Jan 23, 2025 · 1 comment
Open

parallel_for optimization in memory allocation #125

aconstlink opened this issue Jan 23, 2025 · 1 comment
Labels
enhancement New feature or request performance performance related issues

Comments

@aconstlink
Copy link
Owner

The parallel_for is using schedule( motor::shared( task_t...) ) ) in parallel_for.hpp which triggers a memory allocation with the task. When the task is done, it even triggers a deallocation. I think that is completely unnecessary!

There should be a better way to allocate tasks for the parallel_for so that tasks are directly reused. There is the memory arena which does exactly that, but then we can not route the parallel_for tasks the ordinary task scheduling way.

@aconstlink aconstlink added enhancement New feature or request performance performance related issues labels Jan 23, 2025
@aconstlink
Copy link
Owner Author

It came to my mind, that it could also be possible to just up the ref count of all used tasks using motor::share once more, and store all parallel_for tasks internally until destruction and just reuse then that way.

✨ That would be absolutely transparent with the general purpose memory manager currently in use! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request performance performance related issues
Projects
None yet
Development

No branches or pull requests

1 participant