Bug 120110 - [GTK] Skip FontConfig initialization in WebKitTestRunner if requested
Summary: [GTK] Skip FontConfig initialization in WebKitTestRunner if requested
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Zan Dobersek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-21 08:21 PDT by Zan Dobersek
Modified: 2014-01-14 11:46 PST (History)
1 user (show)

See Also:


Attachments
Patch (1.92 KB, patch)
2013-08-21 08:23 PDT, Zan Dobersek
no flags Details | Formatted Diff | Diff
Patch (1.51 KB, patch)
2014-01-13 23:59 PST, Zan Dobersek
mrobinson: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zan Dobersek 2013-08-21 08:21:15 PDT
[GTK] Skip FontConfig initialization in WebKitTestRunner if requested
Comment 1 Zan Dobersek 2013-08-21 08:23:31 PDT
Created attachment 209267 [details]
Patch
Comment 2 Zan Dobersek 2013-08-21 08:26:15 PDT
As described in the change log, FontConfig initialization is pretty heavy computation-wise, and is as such unnecessarily shown as a bottleneck when reviewing the profile. This skews the whole profile and obstructs real problems as the FontConfig setup is not really necessary when not running layout tests.
Comment 3 Martin Robinson 2013-08-21 08:28:55 PDT
It is necessary to produce appropriate test results though, right?
Comment 4 Zan Dobersek 2013-08-21 09:17:31 PDT
When running layout tests, yes.

This shouldn't apply to the performace tests (i.e. when running run-perf-tests and using a profiler), at least at the moment there are no tests testing the performance of anything that strictly relies on specific fonts being present.

I'll think this through before pushing forward - in worst case, the FontConfig functions consuming substantial amount of time could be simply ignored when reviewing the profiles. Unfortunately the perf profiler doesn't provide any obvious mechanisms to ignore specific symbols at either record- or report-time.
Comment 5 Zan Dobersek 2013-08-21 09:19:11 PDT
Comment on attachment 209267 [details]
Patch

I'll spin off the typo fix into a separate patch.
Comment 6 Martin Robinson 2013-08-21 09:29:00 PDT
(In reply to comment #4) 
> This shouldn't apply to the performace tests (i.e. when running run-perf-tests and using a profiler), at least at the moment there are no tests testing the performance of anything that strictly relies on specific fonts being present.

I see. You make a good point. As long as it does not cause tests to start failing, I have no objection.
Comment 7 Zan Dobersek 2014-01-13 23:59:16 PST
Created attachment 221110 [details]
Patch
Comment 8 Martin Robinson 2014-01-14 08:05:54 PST
Comment on attachment 221110 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=221110&action=review

> Tools/WebKitTestRunner/InjectedBundle/gtk/ActivateFontsGtk.cpp:87
> +    if (g_getenv("WKTR_SKIP_FONTCONFIG_INITIALIZATION"))
> +        return;
> +

A "WEBKIT" prefix probably makes more sense here, since that's the one we traditionally use.
Comment 9 Zan Dobersek 2014-01-14 09:34:36 PST
Comment on attachment 221110 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=221110&action=review

>> Tools/WebKitTestRunner/InjectedBundle/gtk/ActivateFontsGtk.cpp:87
>> +
> 
> A "WEBKIT" prefix probably makes more sense here, since that's the one we traditionally use.

I'd then change the variable name to 'WEBKIT_SKIP_WKTR_FONTCONFIG_INITIALIZATION'. Sounds OK?
Comment 10 Martin Robinson 2014-01-14 11:19:12 PST
(In reply to comment #9)
> (From update of attachment 221110 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=221110&action=review
> 
> >> Tools/WebKitTestRunner/InjectedBundle/gtk/ActivateFontsGtk.cpp:87
> >> +
> > 
> > A "WEBKIT" prefix probably makes more sense here, since that's the one we traditionally use.
> 
> I'd then change the variable name to 'WEBKIT_SKIP_WKTR_FONTCONFIG_INITIALIZATION'. Sounds OK?

I'm not a big fan unnecessary abbreviation, so I prefer WEBKIT_SKIP_WEBKITTESTRUNNER_FONTCONFIG_INITIALIZATION.
Comment 11 Zan Dobersek 2014-01-14 11:46:00 PST
Committed r161990: <http://trac.webkit.org/changeset/161990>