Skip to content

Avoid redundant awaits for request-only delegate handlers - #70

Merged
eventhorizon-cli merged 2 commits into
mainfrom
perf/request-only-delegate-forwarding
Oct 25, 2026
Merged

eventhorizon-cli merged 2 commits into
mainfrom
perf/request-only-delegate-forwarding

Conversation

@eventhorizon-cli

@eventhorizon-cli eventhorizon-cli commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

Request-only delegate handlers without injected services currently add an async wrapper even though they have no response validation or scope disposal to perform. Return the invoker's original ValueTask directly on that path; the consumer still awaits actual completion before completing requests and releasing the execution slot.

Keep response validation, service scope disposal, and initial expression compilation intact. Add completion and concurrency regression tests, mixed-submission stress coverage, reusable benchmarks, and the measured before/after results.

Emphasize in the English, Chinese, and NuGet READMEs that every response entry must be assigned exactly once. Missing assignments fail the whole Handler batch; an explicitly assigned null is a valid nullable response.

Validation:

  • Solution build and formatting verification passed.
  • All 483 unit tests passed on each of .NET 8 and .NET 10, including 24,576 request-only stress requests per framework.
  • All ten benchmark cases validated every operation/wave on both revisions.
  • Isolated delegate forwarding allocation fell from 455 B to 319 B. With 20 ms work, explicit 256-request waves fell from 44.04 KB to 42.98 KB; elapsed time remained about 21 ms. These measurements support allocation savings, not a material latency claim.

@codecov

codecov Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.88%. Comparing base (53a864d) to head (fd9e087).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #70   +/-   ##
=======================================
  Coverage   96.88%   96.88%           
=======================================
  Files          38       38           
  Lines        1571     1573    +2     
  Branches      286      287    +1     
=======================================
+ Hits         1522     1524    +2     
+ Misses         20       19    -1     
- Partials       29       30    +1     
Flag Coverage Δ
integration ?
unit 96.88% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@eventhorizon-cli
eventhorizon-cli merged commit 9be066a into main Oct 25, 2026
4 checks passed
@eventhorizon-cli
eventhorizon-cli deleted the perf/request-only-delegate-forwarding branch October 25, 2026 14:25
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