View previous topic :: View next topic |
Author |
Message |
reggy n00b
Joined: 17 Jul 2009 Posts: 8
|
Posted: Fri Jul 17, 2009 8:03 pm Post subject: Some doubt about prelink |
|
|
Hi everybody,
I'm going to install Gentoo on my laptop (Asus F3JC - Intel(R) Core(TM)2 CPU T5600 @ 1.83GHz) and will compile a KDE4 desktop environment. My doubt is about prelink, in its howto says:
Quote: | Prelinking can cut the startup times of applications. For example, a typical KDE program's loading time can be cut by as much as 50%. The only maintenance required is re-running prelink every time a library is upgraded for a pre-linked executable. |
Really it feels much difference? Do you feel your system faster using prelinked binaries?
btw, i'm going to use a 32-bit profile in my gcc configuracion (CFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer"
)
Thanks for your help
Cheers |
|
Back to top |
|
|
widremann Veteran
Joined: 14 Mar 2005 Posts: 1314
|
Posted: Sat Jul 18, 2009 1:53 am Post subject: |
|
|
Remember, it only affects application start-up performance. Once the app is started, it makes no difference*. Also, once you have loaded your DE and a bunch of libraries, the value of prelink is diminished because the libraries have already been loaded and dynamic linking speed for future app loads is already increased.
*Under some circumstances (this may be the general case), calls to functions in libraries will be done via one-time thunks, which will load the library if necessary, and then find the address of the desired function and replace the call to the think with an indirect call to the function itself. I don't know if prelink fills the GOT (global offset table, which must be filled by the thunks) or if it even removes the need to do indirect calls with library functions. If it does, that would mean that runtime performance would improve. |
|
Back to top |
|
|
reggy n00b
Joined: 17 Jul 2009 Posts: 8
|
Posted: Sat Jul 18, 2009 11:57 am Post subject: |
|
|
Thanks for replying.
Well, then this optimization doesn't "guarantee" 50% of better performance initializing your kde desktop, doesn't it?
Cheers |
|
Back to top |
|
|
widremann Veteran
Joined: 14 Mar 2005 Posts: 1314
|
Posted: Sat Jul 18, 2009 2:40 pm Post subject: |
|
|
reggy wrote: | Thanks for replying.
Well, then this optimization doesn't "guarantee" 50% of better performance initializing your kde desktop, doesn't it?
Cheers |
I think it does...maybe not 50%. There's a lot that goes on in program loading and initializing, and dynamic linking is only part of that. Prelink is definitely not worthless, though. |
|
Back to top |
|
|
energyman76b Advocate
Joined: 26 Mar 2003 Posts: 2048 Location: Germany
|
Posted: Sun Jul 19, 2009 4:29 am Post subject: |
|
|
it really depends on the app.
If something is linking against libs like boost - you really want prelink.
In the past I saw nice startup improvements with everything c++ - especially kde.
portage prelinks automatically, if prelink is installed. And in years I haven't seen a downside.
Why not just try it? Best case some apps start faster. Worst case everything is as it was before. _________________ Study finds stunning lack of racial, gender, and economic diversity among middle-class white males
I identify as a dirty penismensch. |
|
Back to top |
|
|
asturm Developer
Joined: 05 Apr 2007 Posts: 8933
|
Posted: Sun Jul 19, 2009 8:37 am Post subject: |
|
|
Probably thanks to that embedded-mysql -fPIC mess, prelink currently breaks amarok:2 collections. I decided to unmerge it again - performance gains seem not worth the hassle when you're running ~arch and shuffling libraries more often than usual... |
|
Back to top |
|
|
energyman76b Advocate
Joined: 26 Mar 2003 Posts: 2048 Location: Germany
|
Posted: Sun Jul 19, 2009 8:44 am Post subject: |
|
|
genstorm wrote: | Probably thanks to that embedded-mysql -fPIC mess, prelink currently breaks amarok:2 collections. I decided to unmerge it again - performance gains seem not worth the hassle when you're running ~arch and shuffling libraries more often than usual... |
hm, why does amarok2 works for me? with collections? and prelink? _________________ Study finds stunning lack of racial, gender, and economic diversity among middle-class white males
I identify as a dirty penismensch. |
|
Back to top |
|
|
asturm Developer
Joined: 05 Apr 2007 Posts: 8933
|
Posted: Sun Jul 19, 2009 8:48 am Post subject: |
|
|
Probably because of our very different Gentoo systems? Well, I didn't notice measurable improvements anyway... |
|
Back to top |
|
|
energyman76b Advocate
Joined: 26 Mar 2003 Posts: 2048 Location: Germany
|
Posted: Sun Jul 19, 2009 8:56 am Post subject: |
|
|
well, you were generalizing.... _________________ Study finds stunning lack of racial, gender, and economic diversity among middle-class white males
I identify as a dirty penismensch. |
|
Back to top |
|
|
asturm Developer
Joined: 05 Apr 2007 Posts: 8933
|
Posted: Sun Jul 19, 2009 9:43 am Post subject: |
|
|
hm, just out of interest:
- your version of amarok, mysql?
- do you have a file /etc/portage/env/dev-db/mysql with "-DPIC -fPIC" additions to CFLAGS, is it still mandatory? |
|
Back to top |
|
|
energyman76b Advocate
Joined: 26 Mar 2003 Posts: 2048 Location: Germany
|
Posted: Sun Jul 19, 2009 9:50 am Post subject: |
|
|
media-sound/amarok
Installed versions: 9999
dev-db/mysql
Installed versions: 5.0.83(14:40:47 07.07.2009)(berkdb community embedded perl ssl -big-tables -cluster -debug -extraengine -latin1 -max-idx-128 -minimal -profiling -selinux -static)
energy dev-db # cat mysql
CFLAGS="-march=k8 -O2 -msse3 -pipe -DPIC -fPIC"
CXXFLAGS="-march=k8 -O2 -msse3 -pipe -DPIC -fPIC"
that file is from November 2008 _________________ Study finds stunning lack of racial, gender, and economic diversity among middle-class white males
I identify as a dirty penismensch. |
|
Back to top |
|
|
asturm Developer
Joined: 05 Apr 2007 Posts: 8933
|
Posted: Sun Jul 19, 2009 9:59 am Post subject: |
|
|
These are except for some CFLAGS and minor USE diffs exactly the same as mine. Yet my collection got severly b0rked (e.g. amarok completely screwing the tags) several times during the last months. Lately it was running fine though until I came up with prelink. |
|
Back to top |
|
|
energyman76b Advocate
Joined: 26 Mar 2003 Posts: 2048 Location: Germany
|
Posted: Sun Jul 19, 2009 10:02 am Post subject: |
|
|
I had collection problems with some amarok versions and none with others. Independent from prelink.
The version that works is from 28.06.2009 _________________ Study finds stunning lack of racial, gender, and economic diversity among middle-class white males
I identify as a dirty penismensch. |
|
Back to top |
|
|
asturm Developer
Joined: 05 Apr 2007 Posts: 8933
|
Posted: Sun Jul 19, 2009 1:42 pm Post subject: |
|
|
My version is from today, and it definitely doesn't work with prelink... |
|
Back to top |
|
|
pingufunkybeat l33t
Joined: 01 Dec 2004 Posts: 610
|
Posted: Sun Jul 19, 2009 2:05 pm Post subject: |
|
|
From my make.conf:
Code: | FEATURES="parallel-fetch ccache prelink"
CFLAGS="-march=native -O2 -pipe"
CXXFLAGS="${CFLAGS}"
|
dev-db/mysql-5.0.76-r1 USE="berkdb embedded perl ssl"
media-sound/amarok-2.1 USE="ipod opengl semantic-desktop"
The -DPIC -fPIC gymnastics haven't been needed for a while. I haven't seen any corruptions since that was resolved, definitely not after upgrading to amarok 2.1 |
|
Back to top |
|
|
|