Repository navigation
perf: cut redundant Sparkplug payload work and bound topology-driven renders - #162
Open
bluegrassiot wants to merge 4 commits into
Open
bluegrassiot wants to merge 4 commits into
bluegrassiot wants to merge 4 commits into
Conversation
Alias enrichment reparsed the Sparkplug protobuf payload and read the application message payload segment a second time for every message. The chart and store handlers now resolve aliases from the envelope the payload pipeline already decoded, and the payload pipeline itself reads the raw payload only on failure paths. Metric merges now index the existing snapshots instead of rescanning the list for each incoming metric, keeping previous order and last-write-wins on duplicate names. Adds regression tests for decoded-payload alias resolution, the plugin decoder fallback when TypedPayload is null or foreign, and in-place metric merge ordering under concurrency.
A burst of Sparkplug topology events drove one render per event on the nodes view and the page shell. Both now signal through a coalescer that holds a single pending slot: the broker thread only requests, the dispatcher reconciles the active tab or selection state and renders at most once per window, and a refresh still queued when the component is disposed never runs. Adds render coalescing tests for the page and the nodes view plus direct coalescer tests, covering burst coalescing, a blocked dispatcher backlog, dispatch failure, and disposal.
[Medium impact] The PR appears safe to merge; both previous findings are addressed and no new actionable issues were found. SummaryThe PR reduces repeated Sparkplug payload reads and parsing, indexes metric merges, and coalesces topology-driven renders.
|
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.
Closes #161
What this does
Two lanes, both aimed at the same failure: throughput collapsing once Sparkplug traffic gets dense.
Core lane: receive, alias and metric work
UI lane: bounded render coalescing
RefreshCoalescerthat holds a single pending slot, so renders are bounded by the coalesce window rather than by event rate.Tests
TypedPayloadis null or a foreign type, and in-place metric merge ordering including concurrent node data.Validation
dotnet build MqttProbe.NoMaui.slnf: 0 warnings, 0 errors.Benchmark
Matched isolated runs on the Release Web host against a local Mosquitto with a headless 50 ms emulator and the same workload (about 528 to 2030 broker-delivered msg/s). At a cap of 50000 the whole-app process CPU was 72 to 82% lower, with no limiter drops. Node and detail interactions still succeed and both views are visible at the end of the run. A complete metrics scrape dropped from 5.7 to 11.4 seconds down to about 1.2 seconds. That is the whole scrape operation, not just a render.
Process CPU as a percentage of one core, by view and load:
Limits of this evidence
Notes
release/v1.0.10, notmain.