Extremely slow ungrouping when a group contains thousands of objects

Summary:

This is like issue inbox#7888 (closed) (which was marked as a duplicate of #1921 (closed), which was reportedly solved), but happening on Inkscape 1.4.2 from Fedora 42's repositories, running on the Wayland GNOME session.

CPU is an 8-cores Xeon.

Steps to reproduce:

  1. Download this sample SVG I created from an EPS import: extremely_slow_ungrouping_of_thousands_of_objects_-_sample_document_file.tar.xz
  2. Extract the .SVG, open it with Inkscape
  3. In the Layers panel, unfold the page
  4. Optional: if you want to make the performance problem 10x worse: unfold the group "group-R5" before doing step no.5
  5. Right-click the group "group-R5"
  6. Click "Ungroup"

extremely_slow_ungrouping_of_thousands_of_objects_-_reproduction_screenshot

What happened?

100% CPU usage on one core, all Inkscape instances freeze for what seems like 5 to 10 minutes at least.

What should have happened?

Gotta go fast!

Version info

Inkscape 1.4.2 (ebf0e940d0, 2025-05-08)

                      Compile  (Run)
    GLib version:     2.84.1
    GTK version:      3.24.49 (3.24.49)
    glibmm version:   2.66.8
    gtkmm version:    3.24.10
    libxml2 version:  2.12.10
    libxslt version:  1.1.43
    Cairo version:    1.18.2 (1.18.2)
    Pango version:    1.56.3 (1.56.4)
    HarfBuzz version: 10.4.0 (10.4.0)

    OS version:       Fedora Linux 42 (Workstation Edition)

Performance profiling information

I recorded a Sysprof capture: extremely_slow_ungrouping_of_thousands_of_objects_-_sysprof_capture.tar.xz

This indicates the main stack of functions eating 99% of the resources:

extremely_slow_ungrouping_of_thousands_of_objects_-sysprof_capture-_flamegraph