Skip to content
Adrian Sampson edited this page Apr 7, 2018 · 7 revisions

Add to this page if you write something inefficient (so you don't have to optimize it if it isn't an issue).

  • incremental imports: currently, the tags (e.g., ID3 header) of every file must be read even for albums that won't eventually be imported. This makes incremental imports way slower than they need to be: a lot of time is wasted reading the tags to create Items that will immediately be skipped. Two possible solutions: make albums_in_dir create Items lazily (only when a directory is actually tagged are the files read) or give it a parameter consisting of a directory blacklist to skip.
  • cache library options (so they don't need to be fetched every time we need the library directory, for instance)
    • cache string.Template(lib.options['path_format']) so it doesn't need to be recreated every time
  • determine whether the current hack for all-column (or even single-column) matching is imposingly slow; if so, explore alternatives:
    • SQLite's full-text search module
    • how do other media managers deal with this?
  • Item could keep a MediaFile around rather than creating it for every read() and write()
  • C implementation of bipartite matching (?)
  • memoization of plurality calculation
  • import optimizations:
    • check options as they arrive from MusicBrainz; if one is a good match, don't bother loading the rest
    • somehow skip the UI pipeline stage for matches that don't need confirmation so they can get directly to the copying/applying phase
    • new phase for album art
    • avoid getting tracks for albums with track number mismatch
Clone this wiki locally