Skip to content

Minimize task creation for concurrent payload visiting#1414

Open
jmaeagle99 wants to merge 1 commit intotemporalio:mainfrom
jmaeagle99:better-concurrent-visitor
Open

Minimize task creation for concurrent payload visiting#1414
jmaeagle99 wants to merge 1 commit intotemporalio:mainfrom
jmaeagle99:better-concurrent-visitor

Conversation

@jmaeagle99
Copy link
Copy Markdown
Contributor

@jmaeagle99 jmaeagle99 commented Apr 6, 2026

What was changed

Update the payload visitor to create async tasks only when there is semaphore availability.

Why?

No need to spawn all async tasks for payload visitor. Task creation is minimized to not use up so many resources simultaneously.

Review Suggestion

This change looks substantial on its own. However, if you compare it to the state of the visitor before concurrent visiting was introduced in 3788785, you'll see it's much simpler. It effectively undoes the mass coroutine creation in that change and only creates async coroutines when visiting the payloads if there is semaphore availability. Here's a link to compare the current changes to just before concurrent visiting was introduced: jmaeagle99/temporalio-sdk-python@718266d...better-concurrent-visitor#diff-719b6ee0e76a1c3bf26e1e3b922da9fec696b6a4d93e8e9e8138cb86bf76bfe9

Checklist

  1. How was this tested: Unit tests
  2. Any docs updates needed? No

@jmaeagle99 jmaeagle99 force-pushed the better-concurrent-visitor branch from 47b6f79 to 4b4e741 Compare April 6, 2026 03:12
@jmaeagle99 jmaeagle99 force-pushed the better-concurrent-visitor branch from 4b4e741 to ecee01a Compare April 6, 2026 03:19
@jmaeagle99 jmaeagle99 marked this pull request as ready for review April 6, 2026 03:27
@jmaeagle99 jmaeagle99 requested a review from a team as a code owner April 6, 2026 03:27
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.

1 participant