https://bugs.documentfoundation.org/show_bug.cgi?id=173238

--- Comment #5 from Jamie Fitzgerald <[email protected]> ---
Thanks Julien. Your backtrace has the symbols mine was missing, so we are
looking at the same code.

I got the cause wrong though. I blamed isPattern(). It is not that. These SVGs
hang on their own, with no PowerPoint file and no shape fill involved at all:

  image44-worst-path.svg   never finished, killed at 300s   the real SVG from
the Canva deck
  repro.svg                never finished, killed at 200s   attachment 208215,
my synthetic one
  svg-fill-repro.pptx      never finished, killed at 200s
  control-png-only.pptx    0.92s

So my summary is wrong where it says the file hangs "because" isPattern()
rasterises the SVG. Anything that draws these SVGs hangs. isPattern() just
happens to be the first thing that tries.

Worth knowing how far off we are. That same image44 file draws in 0.17s with
rsvg-convert, and about 1.9s in headless Chromium including browser startup.
It is ordinary, valid SVG. We appear to be the only ones struggling with it.

Given all that, I am happy for this to be closed as a duplicate of tdf#168699
if that is the better home.

Two things I noticed in createNonzeroConform while digging, in case they help.

1. The early bail-out measures the wrong thing. It gives up when
count() > 1000, but count() is the number of sub-paths, while the work is
closer to count() squared times the number of points in each. My file has 300
sub-paths and never finishes, whereas a file with 1100 simple ones would bail
out immediately.

2. The containment test looks like it does more work than it needs to.
isInside(B2DPolygon, B2DPolygon) checks every point of one polygon against the
other. But solveCrossovers has already removed all the crossings by that point,
so the sub-paths cannot overlap, and a single vertex should be enough to decide
whether one sits inside another. I am not sure what that does to the
bWithBorder=true case where two polygons touch, so someone who knows this code
should check me on it.

Could someone add the perf keyword? I missed it when I filed.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to