beets/beetsplug
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
..
bpd chore: refactor code quality issues 2021-03-11 08:45:42 +05:30
lastgenre lastgenre: Make TitleCasing optional 2020-12-15 23:37:16 +00:00
metasync feat: added github actions 2020-05-25 19:35:15 -04:00
web Fixed bug where readonly value was not being read from config file. 2021-03-12 17:58:35 +00:00
__init__.py
absubmit.py util.command_output: return stderr, too 2019-07-14 18:32:59 +02:00
acousticbrainz.py
aura.py AURA: Small updates to docs and set server version 2021-03-07 18:24:57 +00:00
badfiles.py Use simpler approach of asserting that at most one handler of import_task_before_choice returns an action. 2021-03-28 16:53:01 -05:00
bareasc.py Remove unnecessary call to format. 2021-03-16 22:36:42 +00:00
beatport.py
bench.py
bpm.py
bpsync.py
bucket.py
chroma.py Fixes #3834: 2021-01-19 22:05:34 +00:00
convert.py Merge branch 'master' into pr/item-album-fallback 2021-03-07 09:20:50 -05:00
deezer.py
discogs.py Remove ascii encoding step now library is fixed 2021-03-17 09:06:35 +00:00
duplicates.py
edit.py Replace more instances of unsafe calls to yaml.load 2019-04-20 01:14:15 +02:00
embedart.py
embyupdate.py
export.py Optimise FormattedMapping when querying a specific set of fields 2021-05-01 23:41:09 +02:00
fetchart.py Merge pull request #3560 from davidswarbrick/master 2021-03-23 12:15:51 +01:00
filefilter.py
fish.py chore: refactor code quality issues 2021-03-11 08:45:42 +05:30
freedesktop.py
fromfilename.py
ftintitle.py
fuzzy.py
gmusic.py
hook.py
ihate.py
importadded.py chore: refactor code quality issues 2021-03-11 08:45:42 +05:30
importfeeds.py
info.py Optimise FormattedMapping when querying a specific set of fields 2021-05-01 23:41:09 +02:00
inline.py
ipfs.py Merge pull request #2554 from musoke/python3-plugin-ipfs 2020-07-14 06:58:20 -04:00
keyfinder.py Fix line length 2020-12-07 22:11:08 -05:00
kodiupdate.py
lastimport.py
loadext.py
lyrics.py Review comments 2021-04-11 18:38:01 -05:00
mbcollection.py
mbsubmit.py
mbsync.py chore: refactor code quality issues 2021-03-11 08:45:42 +05:30
missing.py chore: refactor code quality issues 2021-03-11 08:45:42 +05:30
mpdstats.py Clean up strip_path and logging 2021-02-23 10:40:59 +01:00
mpdupdate.py
parentwork.py small problem with parent composer 2020-08-09 18:56:52 +02:00
permissions.py
play.py
playlist.py un-ignore E221 2020-07-11 18:33:08 -07:00
plexupdate.py Rename use_secure to secure and add to changelog 2020-06-08 20:19:19 -04:00
random.py
replaygain.py Merge pull request #3890 from wisp3rwind/pr_rg_import_fixes 2021-03-18 22:42:42 +01:00
rewrite.py
scrub.py
smartplaylist.py fix: revert flake8 change 2020-06-04 02:09:04 -04:00
sonosupdate.py
spotify.py
subsonicplaylist.py chore: refactor code quality issues 2021-03-11 08:45:42 +05:30
subsonicupdate.py style: whitespace fix, remove unnecessary parenthesis 2021-01-19 19:09:30 +01:00
the.py fix regex, add test and changelog entry 2020-07-30 22:42:31 +02:00
thumbnails.py Fix thumbnail plugin pathlib bug (#3360) 2020-07-15 21:00:50 -05:00
types.py confit: replace with confuse in plugins 2019-06-01 10:03:41 +10:00
unimported.py
zero.py