Metadata box tag tooltips re-render Markdown per row, causing severe CPU load during save/selection

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: High
    • 3.0.0rc4
    • Affects Version/s: 3.0.0a1, 3.0.0a2, 3.0.0a3, 3.0.0a4, 3.0.0b1, 3.0.0b3, 3.0.0b4, 3.0.0b5, 3.0.0b7, 3.0.0rc1, 3.0.0rc2, 3.0.0rc3
    • Component/s: Other, User Interface
    • None

      When the metadata box rebuilds its rows (on selection changes and on file updates during a save), it renders a Markdown tag tooltip for every tag row via display_tag_tooltip(). That goes through the module-level markdown.markdown() convenience function, which constructs a brand-new Markdown object, with its full processor registry, parser, and element tree, on every single call.

      With many tags per file across a large bulk save/selection, this produces thousands of short-lived Markdown/Registry/ElementTree objects and pins the CPU at 100%, making Picard unresponsive (and appear to hang).
      It is not a memory leak, memory stays flat, but the allocation churn is very CPU-heavy.

      This is a 3.0 regression: Picard 2.x did not render Markdown tooltips per metadata-box row.

      Steps to reproduce:
      1. Load a large number of files/albums.
      2. Select all and Save (or repeatedly change selection).
      3. Observe sustained 100% CPU and UI unresponsiveness.

      Regression introduced by: commit 23ef205fb ("Display tooltip on first column of metadata box items (tags)"), first shipped in 3.0.0a1. The Markdown-rendered tooltip helper came from 2355f85b0.

      Proposed fix:

      • Reuse a single Markdown instance (reset() + convert()) instead of the per-call convenience function.
      • Cache the deterministic per-tag tooltip output (tag docs are static for the session).

            Assignee:
            Zas
            Reporter:
            Zas
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                Version Package
                3.0.0rc4