Extremely poor performance on save when output includes large CDATA nodes (e.g. <i:pgf> nodes from Illustrator)

Bug #1793877 reported by Marcel Partap on 2018-09-22
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Medium
Patrick Storz

Bug Description

Inkscape 0.92.3 (2405546, 2018-03-11)

What happens when saving an Illustrator SVG is that inkscape writes the SVG up to the <i:pgf id="adobe_illustrator_pgf"> tag, then keeps on adding CDATA in 4K blocks which makes the file grow for like forever.
Instead, inkscape should ask to discard the node. And/or write it faster... And remove it with function "Clean up document" ...

Manual fix for me was to kill that node in the XML editor.. c.f. https://commons.wikimedia.org/wiki/User:Quibik/Cleaning_up_SVG_files_manually

Patrick Storz (ede123) wrote :

Performance issue confirmed. After a few minutes I killed Inkscape which only had ~10% of that file saved. This can't be correct.

In principle exporting as "Optimized SVG" would remove that node, too (when disabling "Export editor data"), however that operation includes Inkscape writing the file to disk first, which is as slow as saving the file manually. Scour itself (the Python extension handling optimized SVG output) handles the file without problems.

"Clean up document" is not meant to remove (potentially important) data like this, so let's look at the performance issue first, which should resolve this bug.

summary: - adobe_illustrator_pgf tag should be removed on save
+ Extremely poor performance on save when output includes large CDATA
+ nodes (e.g. <i:pgf> nodes from Illustrator)
tags: added: performance saving
Changed in inkscape:
status: New → Confirmed
importance: Undecided → Medium
Patrick Storz (ede123) wrote :

I back-ported a fix from master which removes the problematic node and makes saving instant, see
  https://gitlab.com/inkscape/inkscape/commit/549ef9d3383acd62f3fdc7a093f5c9e19134a3b9
and bug #179679.

However figuring out and fixing the underlying performance issue would still be preferable, so I'll leave this bug open for now.

Changed in inkscape:
milestone: none → 0.92.4
status: Confirmed → In Progress
assignee: nobody → Patrick Storz (ede123)
Patrick Storz (ede123) wrote :

I figured out the cause of the incredibly low performance of writing CDATA sections and pushed a fix to master:
  https://gitlab.com/inkscape/inkscape/commit/07078f49b961b996153b0436dfac97871b475b02

If no regressions are found I'll also back-port it to 0.92.x

Patrick Storz (ede123) wrote :
Changed in inkscape:
status: In Progress → Fix Committed
Bryce Harrington (bryce) on 2019-01-18
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers