Skip to content

Conversation

@Kobzol
Copy link
Member

@Kobzol Kobzol commented Feb 10, 2026

To avoid blocking the event loop.

I examined the code and I think that dropping the jobs is actually the most time consuming activity that happens there. The number of jobs will usually be at most in hundreds or thousands, so shifting the Vecs and reclaiming their memory shouldn't take that much time, even when taking memory (de)fragmentation into consideration.
What can take a lot of time is running Drop on a million of tasks though :)

Edit: actually, Core::try_release_memory also shrinks the TaskMap, so I guess that can take a lot of time too. Let's check if this PR solves the issues, and if not, we'll have to somehow interleave those shrinks with the event loop too.

Related issue: #1064

@Kobzol Kobzol requested a review from spirali February 10, 2026 08:31
To avoid blocking the event loop.
@Kobzol Kobzol merged commit edf6185 into It4innovations:main Feb 10, 2026
9 checks passed
@Kobzol Kobzol deleted the job-forget-async branch February 10, 2026 09:01
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.

2 participants