Skip to content

Optimize async pid collection#4218

Closed
preciz wants to merge 2 commits intophoenixframework:mainfrom
preciz:optimize-async-pids
Closed

Optimize async pid collection#4218
preciz wants to merge 2 commits intophoenixframework:mainfrom
preciz:optimize-async-pids

Conversation

@preciz
Copy link
Copy Markdown
Contributor

@preciz preciz commented May 7, 2026

Avoid allocating intermediate maps and their merges.
2-3x faster.

@SteffenDE
Copy link
Copy Markdown
Collaborator

Actually, in this case I'd say performance is not be the highest goal, as this is test only code (only called when you render_async) and I don't believe it will make a measurable impact to overall test run times. So I'd vote for keeping it more readable instead.

By accumulating the async PIDs into a list instead of a Map,
we can avoid the final Map.keys() call. PIDs are guaranteed
to be unique because they represent unique spawned tasks
and cannot be duplicated within the live_async state.
@preciz preciz closed this May 7, 2026
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