From: Dan Kegel <dank@kegel.com>
To: law@redhat.com
Cc: GCC Mailing List <gcc@gcc.gnu.org>, bastian@kde.org
Subject: Re: profile-driven optimization and the linker?
Date: Thu, 25 Nov 2004 21:07:00 -0000 [thread overview]
Message-ID: <41A63996.1020407@kegel.com> (raw)
In-Reply-To: <1101412168.13475.19.camel@localhost.localdomain>
Jeffrey A Law wrote:
>>http://gcc.gnu.org/news/profiledriven.html doesn't mention
>>having ld reorder sections to improve locality of reference
>>of frequently called functions. Has that technique
>>been tried with gcc and binutils?
>
> Yes. I had some success with it a while back.
Was that on static executables, or dynamically linked ones?
> With ELF it's not terribly hard since we can arrange for
> each function to be put in its own section. Thus you get
> to do function-level reordering by just twiddling a linker
> map. In fact, that's where -ffunction-sections name from.
>
> We had some hacks to gprof which would take profile data
> and build a linker map. That's the code that really needs
> to be improved. I never understood the gprof code well
> enough to do it right.
I may take a whack at this in my copious free time.
Are any such hacks online, or shall I just start from scratch?
I guess further discussion should be on the binutils mailing list.
- Dan
p.s.
I first heard of this technique about 1993 or so, when
Lee Hasiuk implemented it on MS-DOS.
http://mail.kde.org/pipermail/kde-optimize/2003-January/000108.html
describes something similar, but which only aimed at
increasing *disk* cache locality when paging in functions from
disk for the first call.
FWIW, Alan Cox mentioned the technique a couple weeks ago,
http://marc.theaimsgroup.com/?l=linux-kernel&m=109935741612533&w=2
but didn't mention any code.
--
Trying to get a job as a c++ developer? See http://kegel.com/academy/getting-hired.html
next prev parent reply other threads:[~2004-11-25 20:59 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-25 19:49 Dan Kegel
2004-11-25 20:38 ` Jeffrey A Law
2004-11-25 21:07 ` Dan Kegel [this message]
2004-11-25 22:52 ` Joseph S. Myers
2004-11-26 5:32 ` Dan Kegel
2004-11-29 18:05 ` Joe Buck
2004-11-25 23:13 ` Jeffrey A Law
2004-11-26 5:08 ` Dan Kegel
2004-11-26 6:19 ` Dan Kegel
2004-11-26 8:55 ` Dan Kegel
2004-11-29 16:30 ` Will Cohen
2004-11-26 0:01 ` Ben Elliston
2004-11-29 16:20 ` Will Cohen
2004-11-30 3:24 ` Dan Kegel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=41A63996.1020407@kegel.com \
--to=dank@kegel.com \
--cc=bastian@kde.org \
--cc=gcc@gcc.gnu.org \
--cc=law@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).