obs-studio icon indicating copy to clipboard operation
obs-studio copied to clipboard

Settings loading slowly on massive scene collections

Open flaeri opened this issue 2 years ago • 15 comments

Operating System Info

Windows 11

Other OS

No response

OBS Studio Version

27.2.3

OBS Studio Version (Other)

No response

OBS Studio Log URL

https://obsproject.com/logs/6z4OmpDLvjpHUSYf

OBS Studio Crash Log URL

No response

Expected Behavior

Expected behavior would be for buttons/functions to load with somewhat similar performance to previous version.

Current Behavior

Currently, 27.2.0-beta1 onwards loads about half as quickly as previous versions when clicking the "settings" button.

Steps to Reproduce

  1. Stock OBS (no plugins etc)
  2. Create a very large scene collection (a lot of scenes and sources) OR import the one provided: Massive.zip
  3. Test performance on 27.2.0-beta1 and newer vs 27.1.3 and older

Anything else we should know?

With the provided scene collection (Massive.zip) I've observed the following approximate values on a modern'ish Laptop.

5-6 sec opening settings on 27.1.3 10-14 sec opening settings on 27.2.0-beta1

On an even larger scene collection I got: 9-10 sec opening settings 27.1.3 25-30 sec opening settings 27-2-beta1

The performance numbers seem identical from 27-2-beta1 compared to latest release (27.2.3 at the time of writing).

The scene collection is just a bunch of simple Color Sources.

I believe the extra time loading is primarily spent on the changes in https://github.com/obsproject/obs-studio/pull/5297

By no means is this meant to be a usable scene scene collection (opening hotkeys or shutting down OBS takes a very very long time). I've observed a couple of people visiting the OBS support channels with similarly sized scene collections complaining of OBS hanging (long loading times).

flaeri avatar Mar 04 '22 15:03 flaeri

I have the same issue. After updating from 27.2.2 to 27.2.3 it started to freeze when I go to "Settings" (freezes during 2-20 minutes, or never open, what leads to a crash. I use a well working massive scene collection (58 scenes)

This only occurs with massive collections, since I updated. Two days ago, with version 27.2.2, it needed about 8 seconds to load with the exactly same scenes.

Win 11, I7 9.thGen, Asus Zenbook ProDuo

jeansuizo avatar Mar 06 '22 22:03 jeansuizo

@jeansuizo This might be a different issue. 27.2.2 and 27.2.3 did not have changes in this regard as far as I know. You're welcome to join the discord, and hit us up in the support channels, and we could have a look. https://obsproject.com/discord

flaeri avatar Mar 07 '22 09:03 flaeri

I can confirm the provided scene collection results in the Settings window taking around 12 seconds to launch in 27.2. If this is considered "massive", then I'm not too worried.

I do plan on looking at ways to optimize the Hotkeys screen now that 27.2 is out and stable. It should hopefully result in similar improvements to opening Settings as #5994 did for the Log Viewer. Nothing to confirm yet though.

WizardCM avatar Mar 07 '22 09:03 WizardCM

I confirm that I have the same problem. I have a lot of scenes and sources. I waited a few seconds on previous versions for the Settings menu to open. Since version 27.2.3 the menu does not seem to want to open at all even after long minutes of waiting. Nothing seems to appear in my log. Thank you very much for investigating this and good luck !

COPAIN.zip 2022-03-23 23-30-25.txt

Copainduweb avatar Mar 23 '22 22:03 Copainduweb

Just for information : unfortunately the problem persists on the version 27.2.4

Copainduweb avatar Apr 01 '22 10:04 Copainduweb

Very closely related to this issue is the obs_data API storage and lookup, which the GUIs tend to use.

I have very large scene collections and my OBS takes over 2 minutes to load currently. One part of the problem is that both obs_data and the properties API have linear insertion, deletion, and search. Creation of data and properties is O(n^2) because of this. Tim has put together a branch for obs_data that changes the storage over to using a hash map instead of a singly-linked list at https://github.com/obsproject/obs-studio/compare/hash-table . In practice the change means that obs_data construction is O(n) instead of O(n^2). When I test that branch, my load times go from 2 minutes and 8 seconds to 1 minute and 3 seconds -- this is for OBS itself, not the settings, however, GUIs will be impacted by that change, too.

The properties API, in addition to its use of obs_data, also has linear complexity for most of its operations (again, meaning O(n^2) for the initial creation of property objects). IIUC, the barrier to switching things over to hash maps before was just not having a hash map implementation in core for those APIs to use. If Tim's branch is merged, it brings in a hash map implementation, so that can be used to further update the properties API which would improve performance for large sets of properties, especially when those properties windows are being loaded.

mattcalabrese avatar Apr 01 '22 19:04 mattcalabrese

I could resolve it! it was a conflict between spanish and English Keyboard in my Shortcuts. It seems that I entered once in Settings without seeing that it was changed, and OBS messed automatically some shortcuts. After a complete revision of all shortcuts, IT WORKS NORMALLY! Before, It needed 12-16 minutes to open my Settings, now it needs only 3 seconds. Hopefully it will keep stable this way.

Please leave your comments, so that we can know if you could resolve it this way!

jeansuizo avatar Apr 06 '22 12:04 jeansuizo

Unfortunately the Settings menu never opens (even leaving the program running for a very long time) so I can't change my shortcuts…

Copainduweb avatar Apr 06 '22 12:04 Copainduweb

I just uninstalled version 27.2.4 to install 27.1.3. I was able to open the Settings menu. I deleted ALL my keyboard shortcuts. I uninstalled 27.1.3 to put back 27.2.4 and the problem is still there. The Settings menu does not open. help :)

Copainduweb avatar Apr 06 '22 13:04 Copainduweb

Windows 10, 64 Bit OBS.

I noticed the same after I upgraded my OBS version. To rule out my plug-ins and specific settings I prepared a vanilla folder with portable mode activated for both OBS 27.1.3 and 27.2.4. I already suspected that the amount of sources is what triggers this, so I created 50 color sources and could already see a difference in loading times of the settings window for both OBS versions.

Since my guess was that it has to do with the number of hotkey fields created on the GUI for the settings dialog I checked what creates more of these fields and surely when instead of 50 color sources I tried with 50 media sources (which create a lot more fields there) the problem became a lot more evident: ezgif-5-472789b645 (OBS 27.1.3 on the left and 27.2.4 on the right)

So that you have another test file in addition to the one the author provided, here's my test scene collection with the 50 empty media sources: Test.txt (rename to Test.json and copy to scenes folder)

YorVeX avatar Jun 17 '22 02:06 YorVeX

I can confirm the provided scene collection results in the Settings window taking around 12 seconds to launch in 27.2. If this is considered "massive", then I'm not too worried.

I do plan on looking at ways to optimize the Hotkeys screen now that 27.2 is out and stable. It should hopefully result in similar improvements to opening Settings as #5994 did for the Log Viewer. Nothing to confirm yet though.

@WizardCM

Sure, I guess it's still manageable albeit making me feel a bit uneasy if I want to access settings during a live stream and OBS just freezes for 10 seconds (that's the time for my normal OBS instance). But isn't this issue asking more for a fix to a problem that 27.2.X introduced and 27.1.X didn't have rather than optimizations? That makes it sound like "hey let's see whether we can get this 20% faster" but I'd rather have that 4-fold increase in loading times (from my test scenario) reverted to the previous state 😛

Also I had the issue that changing some settings and then saving froze it for even 2 minutes, though I must admit that right now I cannot reproduce it anymore. I will report back if I find a reproducible scenario.

YorVeX avatar Jun 17 '22 02:06 YorVeX

I have 169 OBS scenes and OBS freezes for 5-6 minutes after clicking on "Settings" due to the automatically generated hotkeys (each scene has several and they can't be deleted).

I confirmed the issue is due to the number of scenes by performing a fresh install. Without the scenes it functions correctly, but immediately after importing them the problem returns.

The issue could be resolved by giving users the option to delete the automatically generated hotkeys, or via an option to disable the behavior entirely.

SmokeMonsterPacks avatar Jul 23 '22 09:07 SmokeMonsterPacks

Just +1ing this issue. Definitely saw this issue coming. Whenever I added a new hot key, I would avoid at all costs typing a single letter in the search field (I pasted words) as it would lock up OBS for a good moment, while it parses the tons of elements with all their shortcut entries.

Had this problem since the update too, so it's been a while now. I just never open my settings.

Let's say this was bound to happen with the current streaming landscape relying on activating filters that each have their ON and OFF entry.

JdotCarver avatar Jul 23 '22 14:07 JdotCarver

This appears to be resolved in 28.0 beta1. At least, settings opens in 4-5 seconds now. It's still slow but not broken.

SmokeMonsterPacks avatar Aug 04 '22 04:08 SmokeMonsterPacks

Very happy it seems to have improved greatly for you 😄 Whether this should be considered resolved, I'll leave to the team. I tested again with the provided massive.zip SC, and I see similar numbers still.

Version Time (sec)
28-beta1 23-26sec
27.1.3 8-9sec

flaeri avatar Aug 04 '22 06:08 flaeri

Fixed in https://github.com/obsproject/obs-studio/pull/8254

flaeri avatar Mar 19 '23 13:03 flaeri

This seems to still be an issue, or there is a very similar thing happening. I currently have a rather "large" amount of Scenes available to choose from within the Scene Collection drop down. Any sort of interaction with this causes 2-3 minutes of "Not Responding" from OBS. Everything still works, and it does eventually load, but it is borderline un-usuable for showrunning. I believe this is also causing lag when editing the Sources within the individual scenes as well. As it is incredibly laggy when trying to load anything, even an image.

TheHeretric avatar Apr 26 '23 19:04 TheHeretric

Here is a before and after of the memory usage when swapping scenes within the Scene Collection, during the time OBS is entirely locked up and unresponsive, though my camera movements are still shown and things such as that.

image

With more testing as I delete scenes to test, my memory usage spikes several times depending on the Scene Collection and what it contains, but it fluxes throughout in usage, but it always comes back to being usable given enough time.

TheHeretric avatar Apr 26 '23 19:04 TheHeretric

@TheHeretric Please provide a log file. Optionally, please provide a test scene collection to us to investigate. You may provide it privately to us by reaching out to us on our Discord.

RytoEX avatar Apr 26 '23 20:04 RytoEX

This specific issue is about the settings window taking long to load, that was fixed in the current release candidate: https://github.com/obsproject/obs-studio/releases/tag/29.1.0-rc1

29.1 also brings some other improvements to loading times and switching scene collections, but if you have a large amount of sources - especially those that load external resources - some loading time is unavoidable.

derrod avatar Apr 26 '23 20:04 derrod

Sure give me one moment to load a log file and check what version I am currently on. This just started today, and nothing has changed on my end at all in OBS. I checked all Windows settings in case something on their end caused an issue, and that does not seem to be the case. I also uninstalled streamFX, thinking that could possibly be the culprit.

Here is the log file, currently going through the Scene Collection and removing old and unused Collections seeing if it will help (it currently is not)

https://obsproject.com/logs/LR0gZs8LMmXOY5sc

I am currently running 29.0.2

From my reading during this I found that duplicated scenes at one point potentially attributed to this, I don't think I have many, if any, but something to consider maybe?

There are rather large and totally outdated files being called in the Scene Collection, so removing the calls for those isn't unwarranted, it is just odd that now it is causing an issue.

TheHeretric avatar Apr 26 '23 20:04 TheHeretric

https://obsproject.com/logs/LR0gZs8LMmXOY5sc

I am currently running 29.0.2

All of the fixes that we implemented are in 29.1, which is currently in available as a release candidate, but is not yet available as a normal/stable release.

RytoEX avatar Apr 26 '23 20:04 RytoEX

https://obsproject.com/logs/LR0gZs8LMmXOY5sc I am currently running 29.0.2

All of the fixes that we implemented are in 29.1, which is currently in available as a release candidate, but is not yet available as a normal/stable release.

So what would the recommended option be then? As I don't really feel comfortable installing an update to OBS without it being ready to go as that may cause more potential problems.

TheHeretric avatar Apr 26 '23 20:04 TheHeretric

https://obsproject.com/logs/LR0gZs8LMmXOY5sc I am currently running 29.0.2

All of the fixes that we implemented are in 29.1, which is currently in available as a release candidate, but is not yet available as a normal/stable release.

So what would the recommended option be then? As I don't really feel comfortable installing an update to OBS without it being ready to go as that may cause more potential problems.

Wait for 29.1 to become a stable release.

RytoEX avatar Apr 26 '23 20:04 RytoEX

Since this is unrelated to this issue and GitHub issues are not for support, please check our support channels (Discord, Forums, etc.) instead.

(FWIW I'd try removing advanced scene switcher to see if that is blocking something)

derrod avatar Apr 26 '23 20:04 derrod

Since this is unrelated to this issue and GitHub issues are not for support, please check our support channels (Discord, Forums, etc.) instead.

(FWIW I'd try removing advanced scene switcher to see if that is blocking something)

https://obsproject.com/logs/LR0gZs8LMmXOY5sc I am currently running 29.0.2

All of the fixes that we implemented are in 29.1, which is currently in available as a release candidate, but is not yet available as a normal/stable release.

So what would the recommended option be then? As I don't really feel comfortable installing an update to OBS without it being ready to go as that may cause more potential problems.

Wait for 29.1 to become a stable release.

Thanks, I'll do that and thanks for the information. Here's hoping the release is soon.

TheHeretric avatar Apr 26 '23 20:04 TheHeretric