perf: make TUnitMessageBus sync and fix array allocation#4360
perf: make TUnitMessageBus sync and fix array allocation#4360thomhurst merged 3 commits intothomhurst:mainfrom
TUnitMessageBus sync and fix array allocation#4360Conversation
SummaryPerformance optimization that caches the DataTypesProduced array and wraps PublishAsync calls in ValueTask to avoid async state machine overhead. Critical IssuesNone found ✅ SuggestionsConsider consistency in early return patterns: Verify PublishAsync return type: DataTypesProduced caching is a clear win: Previous Review StatusUnable to retrieve previous comments due to GitHub token scope limitations. Verdict✅ APPROVE - No critical issues. The changes are well-motivated performance improvements that align with TUnit's "Performance First" principle. The 15MB savings on TUnit.ExampleProject demonstrates meaningful impact. |
asyncmethods return theTaskDataTypesProducedwould create a new array each time it was calledIDataProducerAgain returning
ValueTaskhere makes the callers state machine larger. I don't think non-genericValueTaskare useful hereBefore
After