Repository navigation
perf(obs-callback): one lock and one thread-local fewer per signal pass (#3350) - #3410
Merged
Merged
Conversation
zackees
enabled auto-merge
November 1, 2026 10:52
5 of 7 tasks
This was referenced Nov 1, 2026
Merged
zackees
added a commit
that referenced
this pull request
Nov 5, 2026
Current master 75a8dd7: signal/emit/4 Rust mean138.56ns vs C86.23ns (1.607x), signal/emit_global/4 Rust215.51ns vs C84.91ns (2.538x); both exceed acceptance1.5x. Command: soldr cargo bench -p obs-c-oracle --bench port_comparison -- signal/emit(_global)?/4 --sample-size50 --measurement-time2 --warm-up-time1. Evidence: /home/niteris/.soldr/logs/porcelain/20261105T062220Z-home-niteris-dev-obs-rust-obs-studio.log. Performance RED is measurement, following #3410/#3427; behavior remains covered by existing callback suite.
chriscoveries
pushed a commit
to chriscoveries/obsrust-fork
that referenced
this pull request
Nov 7, 2026
* test: record signal emission performance RED (obs-rust#3350) Current master 75a8dd7: signal/emit/4 Rust mean138.56ns vs C86.23ns (1.607x), signal/emit_global/4 Rust215.51ns vs C84.91ns (2.538x); both exceed acceptance1.5x. Command: soldr cargo bench -p obs-c-oracle --bench port_comparison -- signal/emit(_global)?/4 --sample-size50 --measurement-time2 --warm-up-time1. Evidence: /home/niteris/.soldr/logs/porcelain/20261105T062220Z-home-niteris-dev-obs-rust-obs-studio.log. Performance RED is measurement, following obs-rust#3410/obs-rust#3427; behavior remains covered by existing callback suite. * perf: remove redundant signal pass locking (obs-rust#3350) Hold the outer mutex guard through each pass and use an owner token for same-thread recursive acquisition. Skip terminal empty snapshots when callbacks did not change the generation. Preserve callback exclusion, nested remove-current behavior, and waiter notification through the standard mutex. * fix: split global signal dispatch to satisfy lint (obs-rust#3350) * perf: skip unchanged signal callback list locks (obs-rust#3350)
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.
Refs #3350 (the rest of the gap stays open).
Three cuts to the per-emit work in
SignalHandler::signal's signal pass. None changes behaviour:signalling += 1moves under the first snapshot chunk's lock, so each emit takes the callbacks mutex three times instead of four.CURRENT_GLOBALalone. It now swapsCURRENT_SIGNALonly.remove_currentreadsCURRENT_SIGNALfirst, so while a signal callback runs, the global slot is never consulted. Its value is restored on exit, unchanged.bumphappens only when the sweep removed entries. Withsignalling == 0no pass on this signal is running, so nothing reads the generation unless the list changed. The sweep moves intoend_signal_passto keepsignal()under clippy's line limit.Measured.
port_comparison(rust/obs-c-oracle/benches), criterion 5 s, load avg about 4–5:signal/emit/4/rustsignal/emit/4/cRED/GREEN. This is a perf change, so the RED is the measurement above. The correctness guard is the existing
callback::suite inobs-tests-core: 87 tests, includingsignal_parityagainst the C oracle (Tier 3). It passes before and after; there is no new failing test to show../lintpasses.Test cost: no new tests.
Not user-visible; no features.md line.