Closed Bug 754644 Opened 10 years ago Closed 4 years ago

Genome Maps is slow


(Core :: SVG, defect)

Not set





(Reporter: scoobidiver, Unassigned)


(Depends on 1 open bug, )


(Keywords: perf, Whiteboard: [in-the-wild] [external-report] [changing the "x" attribute of <rect> is slow due to display list work])


(1 file)


I see no improvements in the trunk.
What about it is slow? What do I need to do that demonstrates slowness?
Just loading is somewhat slower than Chrome or me.  So is clicking on the chromosome.

But yes, a clear description of what's slow from the reporter would be _very_ helpful.

I profiled the two actions above, by the way.  Some things to note for the latter:

30% of the time under nsDocument::EnsureCatalogSheet, called from NS_NewSVGElement.  A lot of this seems to be regathering rule processors.  Wonder why.

30% SVG painting.

10% refresh ticks

10% layout/style flushes from getting computed visibility and left styles in the page while there are pending style//layout changes.
I tried the page in a debug build to see why we have so much EnsureCatalogSheet, but it hits JS "too much recursion" exceptions there...  I'd expect this to happen only once per document, so the fat that it shows up in the profile is pretty confusing.
Component: Graphics → SVG
QA Contact: thebes → general
The catalog sheet thing was bug 754894.

With that locally dealt with, the SVG painting time is 60% of total.  About half of this is under PaintFrameWithEffects calling gfxContext::Paint (ending up under CGContextDrawImage), another 15% is PaintFrameWithEffects calling PushGroup, the rest is scattered about.
For the record: genomemaps currently shows me the following in a notification at pageload, discouraging usage of Firefox for viewing the site:

> This release makes an intensive use of new web technologies and standards
> like HTML5 and SVG, so the browsers that are fully supported and will provide
> the best user experience are:
>   Google Chrome 14+
>   Apple Safari 5+
> Other browsers may rise some errors. Firefox11+ works very slow on Linux and
> Windows 7 and the usage it is not recommended. Internet Explorer 9 is not
> supported since they not support many of the features of HTML5,
> Internet Explorer 10 Consumer Preview works fine.
Clicking on the "Karyotype", "Chromosome" and "Region" buttons is incredibly slow for me.
Keywords: perf
I'm Nacho, the project manager of Genome Maps.

Boris, just to clarify, the notification pageload was added a few days ago, we were forced to add it as the user experience with Firefox was far from good.

>>But yes, a clear description of what's slow from the reporter would be _very_ >>helpful.
well, I think that when compared to Chrome or Safari it's clear what slow means. There is no a smooth navigation with Firefox, when trying to drag it takes a few seconds, ~2sec depending on machine, to move, while in Chrome and Safari is awesome fast.

Our first impression was that the problem was in SVG rendering, but we do not have real debug done yet.
It seems there are a number of uses of opacity that likely should be replaced by fill-opacity. That would probably speed things up.
Hi, I'm Paco, a developer of Genome Maps, i created an svg test with 3500 shapes with 1px height just to measure the performance, try to drag the svg over the x axis. Chrome handles it very well, but Firefox is quite slow.

There is the test:
Thanks frasator! I have a partially written patch that I think will help that testcase.
I think my patch for bug 766429 has fixed the issues here, but it would be good to get other's feedback on that. Anyone willing to test the current nightly? The latest builds here are here:

The first builds to have the fix from bug 766429 are here:
Depends on: 766429
igmecas, is it OK for you in Firefox 19?
Flags: needinfo?(igmecas)

yes and no, things have improved a lot in Windows, unfortunately FF19+ in Linux (64 bits) still is too slow rendering SVG to be usable.

If you try to just move this URL, from an old Comment, in Linux with Chrome and Firefox you will notice the huge difference immediately:

I really appreciate your efforts, do not hesitate to contact me for any information you need.

Flags: needinfo?(igmecas)
Attaching frasator's testcase just to make sure we don't lose it.
So frasator's reduced testcase creates 3500 <rect> elements, and dragging changes the "x" attribute on all of them.

I profiled the testcase with the very latest SVG performance improvements that I _just_ landed on inbound (i.e. it may be a few days before latest Nightly will show time being spent in the same places).

In that profile over 75% of the samples are in ProcessDisplayItems of which the vast majority is spent in nsRegion::sub (72% of the total samples). Only 17% of the time is actually being spent under LayerManagerOGL::EndTransaction actually doing any painting.

So we very much depend on bug 869505 here.
Depends on: 869505
Whiteboard: [changing the "x" attribute of <rect> is slow due to display list work]
Whiteboard: [changing the "x" attribute of <rect> is slow due to display list work] → [in-the-wild] [external-report] [changing the "x" attribute of <rect> is slow due to display list work]
Is this still slow? I just tried to reproduce this in Firefox 60 on Windows 7, for example by clicking the "Karyotype" button, but it works quite well.

Also the reduced test case does not cause performance problems anymore, it is comparable to Chrome.

Maybe this issue can be closed?
I have tested a modified version of svg-stress-test.html with 70000 elements instead of 3500 and the performance in Chrome 67 and Firefox 60 is apparently the same so yes, it can be closed.
Closed: 4 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.