-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Inline plugin - iterating over items for album_fields significantly slows down operations #5773
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I had very similar code and I don't remember 5+ minutes to move 180 files. But it's been a while. Could also be a regression in the 7ish years it's been since I wrote my inline config. https://gist.github.com/RollingStar/86e041338df295afbbf77a9027903068#file-beets_config-yaml-L281 |
If I have time I'll see if I can bisect a version to narrow it down. |
Well I may have misattributed this to Inline since that just happened to make the issue less severe, but it seems more related to the path templating than the actual inline value generation. Using a simple path template of:
It runs in about 3 seconds:
Running something slightly more advanced:
It's about the same:
But as soon as I put in one of the inline fields:
That's when it gets slow:
However if I make it an itemfield, it's fast again:
|
I know nothing about how the inline code works. But, could it be multiplying the overhead by the number of tracks in the album? Say f(item) = 1 second, f(album) = 10 * f(item) if it has 10 tracks. |
My test case was using a title query that I knew only returned a few tracks, in this case 3. However, it was split across (iirc) two albums, so if I need to repro again, I'd be sure to do it on a single album to see what the call counts end up as. |
Attempting to get to the root cause of this
See the results Case 1: No plugins enabled: 1.9s
Case 2: inline with
|
See #5784 for a potential fix: Case 1: No plugins enabled: 1.7s
Case 2: inline with
|
Problem
Using even a simple
album_field
definition such as:significantly degrades performance.
Without:
With:
With more items, it was significantly worse:
w/o:
with: (I actually gave up letting it run)
Setup
My configuration (output of
beet config
) is:The text was updated successfully, but these errors were encountered: