INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: view performance problem caused by unnecessary(?) Smartlist execution  (Read 938 times)

comox

  • Galactic Citizen
  • ****
  • Posts: 402

Scenario:
1) Have several different views open in tabs and select a tab.
2) Select different tab and make no edits to the database.
3) Select original tab. For some views, but not all views, there is a mysterious delay where MC becomes unresponsive and thinks for up to 5 seconds before the tab is displayed.

I have in the past reported this and suggested there may be a problem in the logic MC uses to decide when a view needs to be refreshed. I thought perhaps the delay was caused by an unnecessary refresh.

My assumption was wrong and I think I've figured out what's going on.

Many of my pane views use Search Lists into which I place many different expressions that permit me to apply different filters to the view.

This all works perfectly with no mysterious delays unless one of those expressions makes use of a computationally heavy Smartlist.

It seems a Smartlist in a Search List expression is triggered when the view is selected, even if that expression is not selected in the pane.

I'll bet if you change this so Smartlists are only executed when selected many users may notice that MC is much snappier when switching views.

In the meantime, I'm deleting heavy Smarlists from my Search List expressions.
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 41936
  • Shoes gone again!
Re: view performance problem caused by unnecessary(?) Smartlist execution
« Reply #1 on: March 24, 2023, 01:15:14 pm »

I added the playlist group "Smartlists" to my Panes view.

Switching between tabs is still really snappy.

It lists a lot of smartlists.

Is there some expression I need to use instead?
Logged
Matt Ashland, JRiver Media Center

leezer3

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1569
Re: view performance problem caused by unnecessary(?) Smartlist execution
« Reply #2 on: March 24, 2023, 02:10:49 pm »

Any calculated fields being used in the laggy view?
Logged

comox

  • Galactic Citizen
  • ****
  • Posts: 402
Re: view performance problem caused by unnecessary(?) Smartlist execution
« Reply #3 on: March 24, 2023, 02:36:44 pm »

Note: You'll need to make some edits to reflect the file locations of your library and perhaps to select only audio music in your library.

1) Create a Smartlist named "Artist Without Artwork" with the custom rule:
[=Math(IsMissing(C:\AppData\JRiver\Cover Art\Artists\[Album Artist (auto)].jpg) & IsMissing(C:\AppData\JRiver\Cover Art\Artists\[Album Artist (auto)].png) & IsMissing(C:\AppData\JRiver\Cover Art\Artists\[Album Artist (auto)].gif))]=1

2) In a view create a pane of type Search List and add a filter named "Artist Artwork Missing" with the expression:
Playlist is any "Artist Without Artwork"

3) Open the view in a tab and Clear Selection to ensure the Smartlist filter is not selected.

4) Select a different tab with a different view.

5) Re-select the tab with the Smartlist filter.

You should see MC become unresponsive for a few seconds while it calculates the Smartlist.
Logged

Moe

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 695
  • Hi
Re: view performance problem caused by unnecessary(?) Smartlist execution
« Reply #4 on: March 25, 2023, 11:05:04 am »

IsMissing is notoriously slow as it has to check each folder individually.  It is just the nature of the beast.
Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10712
Re: view performance problem caused by unnecessary(?) Smartlist execution
« Reply #5 on: March 25, 2023, 12:03:14 pm »

Indeed IsMissing hits the file system, all other fields or functions are purely in the library and therefor in memory. IsMissing smartlists will never be fast on a library of any decent size.
Logged
~ nevcairiel
~ Author of LAV Filters

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2368
Re: view performance problem caused by unnecessary(?) Smartlist execution
« Reply #6 on: March 25, 2023, 12:40:29 pm »

(...) IsMissing smartlists will never be fast on a library of any decent size.

Actually...
- On any IsMissing() access for a given file, cache the result
- Use a FileSystemMonitor to update entries already in the cache (MC already uses one to "monitor for external changes" in autoimport)
- Subsequent smartlist executions no longer need to go to the filesystem

This may not work for some/most NAS shares though.
Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10712
Re: view performance problem caused by unnecessary(?) Smartlist execution
« Reply #7 on: March 25, 2023, 01:17:12 pm »

Watching an arbitrary number of arbitrary files outside of the media locations is not going to happen.  There are limits to these functions. Use IsMissing sparingly.
Logged
~ nevcairiel
~ Author of LAV Filters

comox

  • Galactic Citizen
  • ****
  • Posts: 402
Re: view performance problem caused by unnecessary(?) Smartlist execution
« Reply #8 on: March 25, 2023, 07:23:56 pm »

Some Smarlists will be slow. That's understandable and is not a problem.

The problem is that the Smartlist is being executed when the view is selected, even though the filter that uses the Smartlist is not selected.

This means view performance is being degraded for no useful purpose, and presumably is making many user's views slower than they need to be.
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 41936
  • Shoes gone again!
Re: view performance problem caused by unnecessary(?) Smartlist execution
« Reply #9 on: March 25, 2023, 07:38:12 pm »

I tried what you said in the debugger and showing the view or switching tabs wasn't running the expression.
Logged
Matt Ashland, JRiver Media Center

comox

  • Galactic Citizen
  • ****
  • Posts: 402
Re: view performance problem caused by unnecessary(?) Smartlist execution
« Reply #10 on: March 25, 2023, 08:08:57 pm »

I tried what you said in the debugger and showing the view or switching tabs wasn't running the expression.

Please try again with the following pane view settings:
allow tree selection: yes
support tree browsing: no
filter in both directions: yes
enable pane tagging: yes
filter panes based on selection: yes
Logged

comox

  • Galactic Citizen
  • ****
  • Posts: 402
Re: view performance problem caused by unnecessary(?) Smartlist execution
« Reply #11 on: March 25, 2023, 08:11:55 pm »

Also, the Search List with the Smartlist filter should have:
Matching: Match all
Logged

HPBEME

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 959
  • Hoisted by his own petard - Lock him up!
Re: view performance problem caused by unnecessary(?) Smartlist execution
« Reply #12 on: March 26, 2023, 10:05:33 am »

2) In a view create a pane of type Search List and add a filter named "Artist Artwork Missing" with the expression:
Playlist is any "Artist Without Artwork"
I don't know how to solve the lag you are experiencing, but if missing artist artwork is the heart of the issue, can you not just use MC's built-in tool to get all those missing artist images in one shot automatically?  I have a feeling I know why, but will wait for you to reply before I assume (out loud).
Logged

comox

  • Galactic Citizen
  • ****
  • Posts: 402
Re: view performance problem caused by unnecessary(?) Smartlist execution
« Reply #13 on: March 26, 2023, 01:34:53 pm »

Missing artwork is not the heart of the issue.

My Smarlist works perfectly and there are other ways to execute it. I do not do bulk changes to artist artwork as you propose because I sometimes prefer to use my own custom curated artwork.

I don't care if JRiver fixes this issue because I have solved my view performance problems by deleting all heavy Smartlists from Search Lists.

I am pointing out what I believe is a way to improve the performance of pane views that make use of Smarlists in Search Lists
Logged

HPBEME

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 959
  • Hoisted by his own petard - Lock him up!
Re: view performance problem caused by unnecessary(?) Smartlist execution
« Reply #14 on: March 26, 2023, 04:02:35 pm »

I do not do bulk changes to artist artwork as you propose because I sometimes prefer to use my own custom curated artwork.
assumption confirmed… I thought this was the likely reason you didn't want to do a batch update.

When I first added artist pictures to my collection via the method I suggested, I was not overly thrilled with the results. Picture quality was inconsistent, but more importantly, picture aspect ratios were all over the place. Viewing a page with all the artist thumbnails was just a mishmash of different size pictures and not pleasing at all to look at.  Perhaps this is something that JRiver can look into/fix?

On the plus side, the get artist image from last.fm tool only adds an image if there is currently none (i.e., it will not replace existing pictures) - or at least that's what I found to be the case.  Obviously anyone who already has custom artist images for a chunk of their collection should test on a small batch to verify before applying the tool to the entire collection!

What I ended up doing instead was using another media program which did an excellent job on my collection of approximately 1000 artists, and 30,000 songs.  The aspect ratio was always square, and for approximately 70% of the artists, the image was high-to-very high quality with an image size of 1000×1000 or greater.  I then copy/pasted all the images from that program's artist image folder into MC's and overwrote what I had. About 25% of my collection still needs work - when I am motivated and have the time, I manually search for the best artist image I can find using DuckDuckgo, whose image search/filter tool is far superior to Google's.
Logged

comox

  • Galactic Citizen
  • ****
  • Posts: 402
Re: view performance problem caused by unnecessary(?) Smartlist execution
« Reply #15 on: March 26, 2023, 07:13:09 pm »

Your previous tip on AAX was excellent and I'm using it every day with outstanding results.
Logged
Pages: [1]   Go Up