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

ref(processor): Switch processor to a rayon thread pool #3833

Merged
merged 2 commits into from
Jul 18, 2024

Conversation

Dav1dde
Copy link
Member

@Dav1dde Dav1dde commented Jul 18, 2024

Switches the processor from spawn_blocking to a rayon thread pool. We don't need to use the Tokio runtime for the worker threads we can use a dedicated thread pool for this.

The problem with using the tokio thread pool is, the tokio pool may grow largely through other uses of tokio::spawn_blocking, the processor will re-use these threads and will re-initialize all thread local caches on these threads as well. This is a large memory waste and inefficiency.

@Dav1dde Dav1dde self-assigned this Jul 18, 2024
@Dav1dde Dav1dde requested a review from a team as a code owner July 18, 2024 15:33
@Dav1dde Dav1dde force-pushed the dav1d/threadpool branch from c35191d to 23da3aa Compare July 18, 2024 15:35
@Dav1dde Dav1dde force-pushed the dav1d/threadpool branch from 23da3aa to 740a5fa Compare July 18, 2024 16:39
@Dav1dde Dav1dde force-pushed the dav1d/threadpool branch from 740a5fa to dab02eb Compare July 18, 2024 16:39
@Dav1dde Dav1dde enabled auto-merge (squash) July 18, 2024 17:34
@Dav1dde Dav1dde merged commit 89afde6 into master Jul 18, 2024
23 checks passed
@Dav1dde Dav1dde deleted the dav1d/threadpool branch July 18, 2024 17:49
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

Successfully merging this pull request may close these issues.

3 participants