Bug 16302 - [GTK] Compiler flags for optimization
Summary: [GTK] Compiler flags for optimization
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk, Performance
Depends on:
Blocks:
 
Reported: 2007-12-04 20:51 PST by Alp Toker
Modified: 2013-09-11 04:37 PDT (History)
3 users (show)

See Also:


Attachments
Optimization flags (2.71 KB, patch)
2007-12-06 00:27 PST, Alp Toker
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alp Toker 2007-12-04 20:51:05 PST
There are some compiler flags which may help increase performance and reduce footprint in the GTK+ port.

Some appear straightforward, given that we make no use of exceptions or rtti in JSC, WebCore or WebKit (these mainly help reduce code size, but also improve performance):

    -fno-exceptions -fno-rtti

Others flags reported to yield benefits by the Apple WebKit team:

    -O3 makes a big difference over -O2
    -fomit-frame-pointer is a big win

Reportedly significant for JSC:

    -fstrict-aliasing

Some other flags I noticed, that may or may not be relevant:

    -fmessage-length=0 -fvisibility-inlines-hidden -fno-threadsafe-statics

Some of these flags shouldn't be used in Debug builds I'm guessing.

-fomit-frame-pointer has a bad reputation -- we might have a hard time convincing distributions like Debian to leave it on. Numbers might help.

Is this an accurate summary? Any flags that I've missed, or any that are redundant?

Is it worth using a different set of flags for JavaScriptCore and WebCore? It might be easier to just use the same flags for the lot with our current build system.

(I've successfully made a build with all those flags enabled.)
Comment 1 Mark Rowe (bdash) 2007-12-05 06:04:47 PST
We build with -fomit-frame-pointer disabled on the Mac as it makes backtraces from production builds next-to-useless.  Our measurements show it'd be approximately 5% speedup on the JS iBench though.
Comment 2 Alp Toker 2007-12-06 00:27:46 PST
Created attachment 17742 [details]
Optimization flags

The biggest problem with this patch is that -fstrict-aliasing in JavaScriptCore.pri ends up affecting the whole build and getting applied to WebCore, which is not correct. We only want it to apply to JSC.
Comment 3 Alp Toker 2007-12-12 08:29:55 PST
-fno-exceptions -fno-rtti landed in r28651. Other flags still up for discussion.
Comment 4 Alberto Garcia 2013-09-11 04:37:53 PDT
Old bug, I'm closing it as it's no longer relevant, the flags discussed here are either already present or implicitly defined by -O2.