regorxxx / Playlist-Manager-SMP

A playlist manager for foobar2000, using Spider Monkey, to save and load (auto)playlists on demand, synchronizing, ... along many more utilities.
https://regorxxx.github.io/foobar2000-SMP.github.io/scripts/playlist-manager-smp/
GNU Affero General Public License v3.0
56 stars 5 forks source link

[BUG] Performance issues #65

Closed sonofevil closed 1 year ago

sonofevil commented 1 year ago

Describe the bug The panel is very slow and unresponsive on my laptop after recent updates, when previously it worked smoothly. I turned off background images, but it didn't help.

To Reproduce Steps to reproduce the behavior:

  1. Run PM-SMP in Wine on a device with similar specs.

Expected behavior Script runs smoothly.

Screenshots Visual changes are slow and unresponsive (I'm getting maybe like 4 frames per second and there is a very noticeable delay between any interaction and response).

Desktop (please complete the following information):

sonofevil commented 1 year ago

None of my system resources is actually maxed out so idk what's going on.

regorxxx commented 1 year ago

Redownload the package.

sonofevil commented 1 year ago

Redownload the package.

No difference, regardless of whether I use release v0.5.0-beta.25 or a git clone.

regorxxx commented 1 year ago

Can not reproduce it, try it on a new clean portable install.

regorxxx commented 1 year ago

image

sonofevil commented 1 year ago

On a clean, portable installation, the performance decreases as the number of displayed playlists increases. If I have the same number of playlists displayed as on my old installation, the performance becomes just as slow. If I change the filters so that fewer playlists are displayed, it becomes faster. It doesn't matter which wineprefix I use either.

regorxxx commented 1 year ago

I don't really understand your problem. I mean, with 10 playlists shown on the list it has zero impact on windows. Not sure what your numbers are.

The manager may track thousands of playlists, but the actual playlists shown can not be so high anyway. Please show a gif and paste your properties. If this was a SMP performance problem it would have appeared before too, but you said it only happens on new versions (?).

There has been no change on UI related to performance except the shadow on text/art background [both] which can be disabled.

regorxxx commented 1 year ago

Also I'm not sure about your last reply. You say:

If I change the filters so that fewer playlists are displayed, it becomes faster.

These are the playlists displayed. image

It doesn't matter which filter you use, as long as there are more playlists than the current height, no more can be shown and thus they don't affect [UI painting] performance at all.

Now if you are talking about the panel total playlists tracked... that's an entirely different problem than the one described. I have +100 playlist on a panel without any performance problem.

sonofevil commented 1 year ago

I don't really understand your problem. I mean, with 10 playlists shown on the list it has zero impact on windows. Not sure what your numbers are.

The manager may track thousands of playlists, but the actual playlists shown can not be so high anyway. Please show a gif and paste your properties. If this was a SMP performance problem it would have appeared before too, but you said it only happens on new versions (?).

There has been no change on UI related to performance except the shadow on text/art background [both] which can be disabled.

I only have 28 playlists displayed right now. It becomes noticeably slower with every added playlist.

I have all fancy effects in the settings set to disabled. I'm not sure how to enable or disable text shadow and I can't find "shadow" mentioned in the docs.

vokoscreenNG-2023-07-31_12-38-11.webm

sonofevil commented 1 year ago

Well this is strange. I did some testing on 0.5.0 beta 20, and unlike my previous experience it is also slow, but the performance issue immediately disappears if I disable "show name/category separators" (perhaps I had it disabled in the past). However, this does not work with v0.5.1. Here I cannot find any setting that noticeably impacts performance.

sonofevil commented 1 year ago

Ah, there we go. In v0.5.1 it is font shadow (I finally found it). "Show name/category separators" has no impact here.

regorxxx commented 1 year ago

It may be that wine performance is heavily affected by some SMP drawing methods then.

I'm going to disable shadows (by default) whenever art background is also disabled, since both are meant to be used together. And then add some kind of warning either via popups or docs about this.

Now, if you are interested in further testing, I could provide you some test files to try to find an alternate method to create the shadows while also being fine on wine. On windows there is no difference at all with shadows...

regorxxx commented 1 year ago

Nevermind, optimized it. If there is any problem now, it's a SMP performance problem; can not be optimized anymore.

sonofevil commented 1 year ago

It may be that wine performance is heavily affected by some SMP drawing methods then.

I'm going to disable shadows (by default) whenever art background is also disabled, since both are meant to be used together. And then add some kind of warning either via popups or docs about this.

Now, if you are interested in further testing, I could provide you some test files to try to find an alternate method to create the shadows while also being fine on wine. On windows there is no difference at all with shadows...

Sorry for the late reply. Wine performance has some weird random issues with seemingly harmless things. For example if you open the settings page for Foobar2000 keyboard shortcuts, it takes forever to load, and freezes every time you type something in the search box. This issue hasn't gone away in 5+ years. So yeah, not surprised that Wine struggles with some things in SMP.

regorxxx commented 1 week ago

I have found some performance problems related to columns usage (they were being calculated on every paint call), they should be fixed now on latest commits. Maybe that was also impacting your setup.