rembo10/headphones — pull request #1259 by theguardian (2013-10-01 19:32:14+00:00)
Title: Rehashed "update active artist" algorithm to address time/CPU load issue...

Was:
It took ~20 hours with 100% CPU load to update ~700 active artists because the program was constantly “upserting” information it found in MusicBrainz, requiring endless dB commits.
Is:
It now takes ~20 minutes with ~idle CPU load to update ~700 active artists. The trick was to change the program to only make dB commits when it finds deltas from what is provided by MusicBrainz. It also cleans the tables to make sure that there aren’t any extraneous entries left behind. All in all, I think this is a clean solution