Pass -O to ld on platforms where it's supported

RESOLVED WONTFIX

Status

SeaMonkey
Build Config
RESOLVED WONTFIX
15 years ago
13 years ago

People

(Reporter: Brian Ryner (not reading), Assigned: Brian Ryner (not reading))

Tracking

({perf})

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

15 years ago
We should pass -O1 (the number is actually not important) to the linker for
optimized builds if it's gnu ld or another linker that supports it.  This flag
causes the linker to perform some extra optimizations such as optimizing the
hash table size for symbol lookups.

gcc does _not_ pass -O through to the linker, so we'll need -Wl,-O1.
(Assignee)

Comment 1

15 years ago
Created attachment 110717 [details] [diff] [review]
patch
(Assignee)

Updated

15 years ago
Attachment #110717 - Flags: review?(seawood)

Comment 2

15 years ago
Somebody should make some performance tests after applying this patch.

I know I asked for this change but the use of it in a project with many large
hash tables and many DSOs might not be ideal.  At least not with the current
implementation of the optimization in the linker.  I do have a refined version
of the heuristic algorithm in my linker but this one isn't used yet.

The characteristic of the current algorithm is to heavily perfer small tables. 
For large hash tables this means long hash chains and, compared to the default
ld behavior which creates excessively large hash tables, slower lookups.  But
the whole thing might of course still be beneficial since the tables are
significantly smaller which can help the data cache locality.

So, I suggest running some benchmarks and weigh the results.
(Assignee)

Comment 3

15 years ago
I'll run it through the pageload test and startup test.
*** Bug 99437 has been marked as a duplicate of this bug. ***
(Assignee)

Comment 5

15 years ago
I'm not convinced that this causes a slowdown as mentioned in bug 99437.  In my
testing, the performance for both startup and pageload appeared to be reasonably
close, probably within the margin of error of the test.
(Assignee)

Comment 6

15 years ago
I also don't see any measurable change in footprint.  I don't think we're going
to get a win from this.
Status: NEW → RESOLVED
Last Resolved: 15 years ago
Resolution: --- → WONTFIX
Attachment #110717 - Flags: review?(seawood)
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.