Uploaded image for project: 'Picard'
  1. Picard
  2. PICARD-1339

Removing unclustered files can be very slow

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: High High
    • 2.1
    • 2.0.4
    • User Interface
    • None

      To reproduce:

      • add 2000+ files to Unclustered Files
      • select Unclustered Files
      • press Remove

      The offender is https://github.com/metabrainz/picard/blob/master/picard/cluster.py#L117
      The call to update_metadata_images iterates over all files checking image changes for the cluster / album / track

          [PICARD-1339] Removing unclustered files can be very slow

          The committed fix has side effects. The issue is that remove_file() is not only used for actually removing a file completely, but also when moving files between clusters and/or tracks. In these cases the parent cluster/track currently is not updated anymore.

          But actually the same performance issues apply there: Moving a huge amount of files between one cluster/track and another causes the same unnecesary update_metadata_images calls. So we should fix these cases as well properly.

          Philipp Wolfer added a comment - The committed fix has side effects. The issue is that remove_file() is not only used for actually removing a file completely, but also when moving files between clusters and/or tracks. In these cases the parent cluster/track currently is not updated anymore. But actually the same performance issues apply there: Moving a huge amount of files between one cluster/track and another causes the same unnecesary update_metadata_images calls. So we should fix these cases as well properly.

          Zas added a comment -

          After investigation it appears the issue is even worse, as it concerns any removal or move action (cluster to cluster), removing 11 files leads to 88 calls to update_metadata_images ...

          Zas added a comment - After investigation it appears the issue is even worse, as it concerns any removal or move action (cluster to cluster), removing 11 files leads to 88 calls to update_metadata_images ...

            outsidecontext Philipp Wolfer
            zas Zas
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Version Package
                2.1