Repository navigation
perf(obs-callback): one lock fewer and no generation bump per global signal pass (#3350) - #3427
Merged
Merged
Conversation
zackees
enabled auto-merge
November 1, 2026 12:30
This was referenced Nov 1, 2026
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 (under #3176). This is the global-callback half of #3410.
Change in
Signals::signal's global pass, as #3410 did for the per-signal pass:signallingrises under the first snapshot chunk's lock, not in a separate lock: one lock fewer per emit.generationonly if it removed an entry. A plain pass no longer invalidates snapshots in other passes.Behaviour is unchanged: all 87
callback::tests pass, including the reentrancy, connect/disconnect-in-callback and global-callback cases and the C-oracle parity../lintpasses. There are no new tests (a pure perf change to covered code, as in #3410).Measured.
port_comparisonsignal/emit_global/4, interleaved master/change runs on a busy host (load average about 12), criterion 4 s:That's about −9%. The remaining gap to C is per-callback (the snapshot copy, the thread-local index store and the closure call), and #3350 stays open for it.