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



Build Config
15 years ago
13 years ago


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



Firefox Tracking Flags

(Not tracked)



(1 attachment)



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.

Comment 1

15 years ago
Created attachment 110717 [details] [diff] [review]


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.

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. ***

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.

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.
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.