Files
beets/docs/plugins
Sam Thursfield 2fa3717731 Optimise FormattedMapping when querying a specific set of fields
This changes greatly improves the speed of `beet export` and `beet info`
when the `--include-keys` option is used. It also removes the globbing
feature of `--include-keys` that was added in #1295. (See #3762 for
discussion).

Listing all fields for an item requires querying the database to find
any flex attributes. This is slow when done for every item being
exported. We already have a way for the user to specify a fixed set
of keys, but we previously queried everything and filtered it afterwards.
The new approach is more efficient.

Code that iterates through all fields now have to handle invalid field
names. The export and info plugins output invalid fields as None.

Timings before:

    > /usr/bin/time beet export -i title,path,artist -l  Bob Dylan
    13.26user 20.22system 0:34.01elapsed 98%CPU (0avgtext+0avgdata 52544maxresident)k

    > /usr/bin/time beet export -l  Bob Dylan
    12.93user 20.15system 0:33.58elapsed 98%CPU (0avgtext+0avgdata 53632maxresident)k

Timings after:

    > /usr/bin/time beet export -l  Bob Dylan
    13.33user 20.17system 0:34.02elapsed 98%CPU (0avgtext+0avgdata 53500maxresident)k

    > /usr/bin/time beet export -i title,path,artist -l  Bob Dylan
    0.49user 0.07system 0:00.56elapsed 98%CPU (0avgtext+0avgdata 50496maxresident)k

Notice the dramatic speedup in the last example!
2021-05-01 23:41:09 +02:00
..
2017-05-05 19:52:55 +01:00
2019-10-05 20:59:47 -07:00
2020-10-08 00:35:03 -07:00
2016-02-05 13:12:46 +01:00
2020-02-26 19:15:44 -08:00
2015-01-26 23:26:54 +01:00
2016-04-30 15:12:07 -07:00
2016-01-18 16:08:54 -05:00
2019-06-05 03:11:49 +02:00
2019-04-21 15:10:28 +01:00
2021-03-28 14:23:38 -04:00
2019-06-05 03:11:49 +02:00
2019-06-05 03:11:49 +02:00
2017-03-18 19:05:46 -04:00
2021-02-22 14:28:14 +01:00
2016-12-26 16:10:46 -05:00
2019-10-15 21:54:35 +02:00
2019-08-01 09:32:33 -04:00