I just cut my Artist Picture Lookup time on a rescan by 90% (but I'm not
sure if it is the right thing to do)!

I recently noticed that Importer2::_precacheArtistImage -always-
recaches the artist images during a scan. Further investigation showed
that this was because the key in the imgproxy.db cache includes the
Artist ID, which was changing on every full rescan. This leads to two
problems.

  
- imgproxy.db grows on each scan because all the old items are left in
  (I confirmed this with the DatabaseQuery plugin).
- The scan is much slower because it can't find any of the cached
  artist images -even though they are already in the cache-
  

To measure the performance effect, I modified the MAI ImageProxy cache
to use the utf8-escaped artist names instead of the Artist IDs, and the
ArtistPictureLookup time for 1287 artists dropped from 40 seconds on the
first scan down to 3 seconds on subsequent scans! After making some
small changes to CustomBrowse and TrackStat to use the new cache keys,
things seem to work alright, at least in a quick ride around the block.

Does my analysis seem correct? Is there anything wrong with my solution?
I'm happy to share the code changes. Does anything in addition to
artists in MAI use similarly unstable ids? In either case, I'm assuming
the indefinitely growing Image Proxy cache should be fixed.

Any thoughts greatly appreciated,
Mike


------------------------------------------------------------------------
mps's Profile: http://forums.slimdevices.com/member.php?userid=36351
View this thread: http://forums.slimdevices.com/showthread.php?t=99537

_______________________________________________
plugins mailing list
plugins@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/plugins

Reply via email to