Error console performance

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Error console performance

Boris Zbarsky
So I discovered today that on trunk the error console takes _forever_ to open.
To be precise, starting with a blank error console, then loading the following HTML:

<script>
for (var i = 0; i < 20; ++i) {
   setTimeout("throw 'This is a test of the emergency broadcast system; only a
test and all that dudes'", 0);
}
</script>

then opening the error console, I see it take 15-20 seconds for the window to
appear.

A profile shows that we're spending a _lot_ of time in reflow (pretty much all
the time is in InitialReflow()) and of the reflow time about 90% is spent under
nsTextFrame::MeasureText.  Almost all of that is under gfxPangoTextRun::Measure,
gfxPangoTextRun::~gfxPangoTextRun, and gfxPangoFontGroup::MakeTextRun (with
these last two accoundting for about 15% of the MeasureText time, with the rest
under Measure).  The time under Measure is almost all
gfxPangoTextRun::EnsurePangoLayout.

Of particular interest is pango_context_get_base_dir, which takes up about 25%
of total layout time.  This seems to be doing a lot of mallocing, removing from
font maps, creating new script iters, bsearch, hashtable lookups, utf8 to ucs4
conversion, etc...

I see this in both Firefox and Seamonkey cairo builds.

For comparison, the non-cairo builds open up the Error Console in about 4
seconds (which is _still_ ridiculous) when using the same testcase.  So there is
probably also the problem of us doing a _lot_ of reflow here for some reason.
And of cairo making that about 5x slower... :(

I'd be happy to mail the profile to anyone interested in it.

Also of interest, a reflow branch non-cairo build opens the console about twice
as fast as a trunk non-cairo build.  I don't have a reflow branch cairo build on
hand to test with, though.

-Boris
_______________________________________________
dev-performance mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-performance
Reply | Threaded
Open this post in threaded view
|

Re: Error console performance

Jonathan Watt-3
Boris, did you file a bug for this?

Boris Zbarsky wrote:

> So I discovered today that on trunk the error console takes _forever_ to
> open. To be precise, starting with a blank error console, then loading
> the following HTML:
>
> <script>
> for (var i = 0; i < 20; ++i) {
>   setTimeout("throw 'This is a test of the emergency broadcast system;
> only a test and all that dudes'", 0);
> }
> </script>
>
> then opening the error console, I see it take 15-20 seconds for the
> window to appear.
>
> A profile shows that we're spending a _lot_ of time in reflow (pretty
> much all the time is in InitialReflow()) and of the reflow time about
> 90% is spent under nsTextFrame::MeasureText.  Almost all of that is
> under gfxPangoTextRun::Measure, gfxPangoTextRun::~gfxPangoTextRun, and
> gfxPangoFontGroup::MakeTextRun (with these last two accoundting for
> about 15% of the MeasureText time, with the rest under Measure).  The
> time under Measure is almost all gfxPangoTextRun::EnsurePangoLayout.
>
> Of particular interest is pango_context_get_base_dir, which takes up
> about 25% of total layout time.  This seems to be doing a lot of
> mallocing, removing from font maps, creating new script iters, bsearch,
> hashtable lookups, utf8 to ucs4 conversion, etc...
>
> I see this in both Firefox and Seamonkey cairo builds.
>
> For comparison, the non-cairo builds open up the Error Console in about
> 4 seconds (which is _still_ ridiculous) when using the same testcase.  
> So there is probably also the problem of us doing a _lot_ of reflow here
> for some reason. And of cairo making that about 5x slower... :(
>
> I'd be happy to mail the profile to anyone interested in it.
>
> Also of interest, a reflow branch non-cairo build opens the console
> about twice as fast as a trunk non-cairo build.  I don't have a reflow
> branch cairo build on hand to test with, though.
>
> -Boris
_______________________________________________
dev-performance mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-performance
Reply | Threaded
Open this post in threaded view
|

Re: Error console performance

Boris Zbarsky
Jonathan Watt wrote:
> Boris, did you file a bug for this?

No.  There are lots of cairo bugs reported already, and I couldn't really tell
whether this was Just Another One.  I mostly posted in case the profile data is
useful to the cairo folks.

Feel free to file one and mark it blocking the cairo perf regression bug, of course.

-Boris
_______________________________________________
dev-performance mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-performance
Reply | Threaded
Open this post in threaded view
|

Re: Error console performance

Jonathan Watt-3
Boris Zbarsky wrote:
> Jonathan Watt wrote:
>> Boris, did you file a bug for this?
>
> No.  There are lots of cairo bugs reported already, and I couldn't
> really tell whether this was Just Another One.  I mostly posted in case
> the profile data is useful to the cairo folks.
>
> Feel free to file one and mark it blocking the cairo perf regression
> bug, of course.

I filled https://bugzilla.mozilla.org/show_bug.cgi?id=346641 but I can't find
the cairo perf regression bug, so maybe you could add it as a blocker?

Jonathan
_______________________________________________
dev-performance mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-performance
Reply | Threaded
Open this post in threaded view
|

Re: Error console performance

James Ross
Jonathan Watt wrote:
> I filled https://bugzilla.mozilla.org/show_bug.cgi?id=346641 but I can't
> find the cairo perf regression bug, so maybe you could add it as a blocker?

I've made it block the cross-platform cairo perf regression bug for now.
If it's only this bad on Linux, that can be changed to match.

--
James Ross <[hidden email]>
ChatZilla Developer
_______________________________________________
dev-performance mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-performance
Reply | Threaded
Open this post in threaded view
|

Re: Error console performance

Jonathan Watt-3
James Ross wrote:
> Jonathan Watt wrote:
>> I filled https://bugzilla.mozilla.org/show_bug.cgi?id=346641 but I
>> can't find the cairo perf regression bug, so maybe you could add it as
>> a blocker?
>
> I've made it block the cross-platform cairo perf regression bug for now.
> If it's only this bad on Linux, that can be changed to match.

Maybe both. There are likely cairo issues on both windows and unix.
_______________________________________________
dev-performance mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-performance