perf(core): reduce noop wait signal overhead#2690
Draft
Ahoo-Wang wants to merge 5 commits into
Draft
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 4 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2690 +/- ##
============================================
- Coverage 92.67% 92.65% -0.02%
- Complexity 4255 4262 +7
============================================
Files 753 753
Lines 13493 13511 +18
Branches 963 966 +3
============================================
+ Hits 12504 12519 +15
- Misses 607 609 +2
- Partials 382 383 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
waitingLast()for the common single empty-result signal case by returning the original signal instead of copying and merging maps.DefaultCommandGateway.sendAndWaitForSentfast path that bypasses generic wait strategy registration, wait headers, sink subscription, andwaitingLast()for the sent convenience API.Changes
wow-benchmarks: includesWaitNotifyComponentBenchmarkin the smoke suite and adds sent wait propagation/notification benchmarks.wow-core: extracts wait signal result merging helpers and uses a single-signal fast path inWaitingFor.waitingLast().wow-core: updatesWaitingForAfterProcessed.waitingLast()to share merge logic while preserving target-stage metadata.wow-core: overridessendAndWaitForSentinDefaultCommandGatewayto return a directSENTresult after command bus send succeeds.docs/superpowers: records the noop benchmark performance designs used for the implementation.Benchmark Result
Quick E2E directional result for
CommandWriteE2EBenchmark.sendAndWaitSent (scenario=noop-store):Processed noop remained in the same allocation range and is not claimed as optimized by the sent fast path:
sendAndWaitProcessed(noop-store)sendAndWaitProcessed(noop-store)Testing
./gradlew :wow-core:test --tests "me.ahoo.wow.command.DefaultCommandGatewayTest"./gradlew :wow-core:test --tests "me.ahoo.wow.command.wait.stage.WaitingForStageNotificationTest" --tests "me.ahoo.wow.command.wait.chain.SimpleWaitingForChainNotifyTest"./gradlew :wow-core:test --tests "me.ahoo.wow.command.wait.*"./gradlew :wow-core:test./gradlew :wow-core:check./gradlew :wow-benchmarks:benchmarkSmoke --stacktrace./gradlew :wow-benchmarks:benchmarkQuickComponentThread1 --stacktrace./gradlew :wow-benchmarks:benchmarkQuickE2E :wow-benchmarks:generateBenchmarkReport --stacktraceRisk & Compatibility
sendAndWaitForSent(command)no longer writescommand_wait_*headers or registers a wait strategy; this is intentional for the sent convenience API because it completes at gateway send success.send(command, waitStrategy),sendAndWait(command, waitStrategy), streaming waits, and downstream stage propagation keep the existing wait strategy behavior.waitingLast()single empty-result fast path returns the original emittedWaitSignal, relying on emitted signals not being mutated after emission.Review Notes
DefaultCommandGateway.sendAndWaitForSentoverride as the main behavior change.WaitingForAfterProcessed.waitingLast()fallback path; it preserves failed previous-stage signals when the target stage never arrives.