Use obs::fast_signal by default for better performance and smaller widgets#5703
Merged
Conversation
…dgets E.g. safe_signal -> fast_signal sizeof(Widget) = 544 -> 384 bytes sizeof(ButtonBase) = 800 -> 480 sizeof(Entry) = 776 -> 536 sizeof(ComboBox) = 976 -> 576 sizeof(LinkLabel) = 760 -> 520 sizeof(Menu) = 672 -> 432 sizeof(MenuItem) = 696 -> 456 sizeof(Window) = 968 -> 568
ckaiser
approved these changes
Mar 13, 2026
ckaiser
left a comment
Member
There was a problem hiding this comment.
LGTM!
I added some asserts inside the signals and slots to make sure we weren't accidentally using them inside multiple threads and then ran some tests and did some manual normal use just to make sure and this feels pretty safe.
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.
This patch makes
obs::signal=obs::fast_signal(before it wasobs::safe_signal).The new
obs::fast_signalis smaller (just astd::vectorinstead of mutexes/conditional_variables, etc.) and when it's iterated a copy of the vector is created (we need this because there are some cases where a connection/slot is disconnected in the same signal).It's here just to give a general look, not sure if there are some signal that might need to be converted to
obs::safe_signal(e.g. if the signal is used between multiple threads).