Author Topic: Playing with Prelink  (Read 10422 times)

Offline Texstar

  • Administrator
  • Super Villain
  • *****
  • Posts: 12662
Playing with Prelink
« on: September 17, 2010, 11:38:36 PM »
prelink is a free program written by Jakub Jelínek of Red Hat for POSIX-compliant operating systems, principally Linux (because it modifies ELF executables). It is intended to speed up a system by reducing the time a program needs to begin. Actual results have been mixed, but it seems to aid systems with a large number of libraries, such as KDE.

1. Install prelink from Synaptic Package Manager

2. Open terminal konsole su to root and type /usr/sbin/prelink -avmR

3. While still in terminal edit /usr/bin/startkde with your favorite text editor. Add the line highlighted in bold to startkde.

export KDE_NO_IPV6=True
export KDE_USE_IPV6="no"
export KDE_IS_PRELINKED=1

Save the file and exit.

4. Reboot and see if your applications launch faster.

Security Bonus: prelink is capable of randomly selecting the address base that libraries are loaded at. This makes it more difficult to perform a return-to-libc attack on the system, because the addresses used are unique to that system.

* Not responsible if this causes your system to crash and burn. * :D
« Last Edit: September 18, 2010, 09:21:08 AM by Texstar »

Thanks to everyone who donates. You keep the servers running.
Follow me on Twitter for the latest development info.

Offline Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11689
  • ----IOFLU----
Re: Playing with Prelink
« Reply #1 on: September 17, 2010, 11:42:24 PM »
This was a great post... until the last line.  ;D ;D
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

Offline gseaman

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 3892
Re: Playing with Prelink
« Reply #2 on: September 17, 2010, 11:45:33 PM »
Time to burn my system!

Galen

Offline Texstar

  • Administrator
  • Super Villain
  • *****
  • Posts: 12662
Re: Playing with Prelink
« Reply #3 on: September 17, 2010, 11:50:32 PM »
I've noticed Firefox and Thunderbird are quicker to start on my system course it could be a jedi mind trick. Still playing... :D


« Last Edit: September 18, 2010, 12:15:16 AM by Texstar »

Thanks to everyone who donates. You keep the servers running.
Follow me on Twitter for the latest development info.

Offline gseaman

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 3892
Re: Playing with Prelink
« Reply #4 on: September 18, 2010, 12:05:39 AM »
I have no scientific verification, but it seems faster. And nothing burned. I guess I can go to bed now. ;)

Galen

smcs_steve

  • Guest
Re: Playing with Prelink
« Reply #5 on: September 18, 2010, 01:03:13 AM »
No difference here on FF.....   but some other apps do appear faster to launch.
I like the security aspect though.
>Steve

Offline pinoc

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2881
    • other projects...
Re: Playing with Prelink
« Reply #6 on: September 18, 2010, 03:04:28 AM »
applied to fullmonty and applications seem to start a bit snappier now.
Don't know if this is critical but while running  "/usr/sbin/prelink -avmR " I got this:
Code: [Select]
[root@localhost ~]# /usr/sbin/prelink -avmR
/usr/sbin/prelink: "/usr/bin/unetbootin" has no section headers
/usr/sbin/prelink: /usr/bin/fglrx_xgamma: Could not find one of the dependencies     
/usr/sbin/prelink: /usr/bin/q4wine-cli: Could not find one of the dependencies
/usr/sbin/prelink: /usr/bin/jahshaka: section file offsets not monotonically increasing
/usr/sbin/prelink: /usr/bin/q4wine: Could not find one of the dependencies
/usr/sbin/prelink: /usr/bin/q4wine-helper: Could not find one of the dependencies   
/usr/sbin/prelink: /usr/bin/xara-extreme: section file offsets not monotonically increasing
/usr/sbin/prelink: /usr/games/gltron: Could not find one of the dependencies         
/usr/sbin/prelink: /usr/lib/R/bin/exec/R: Could not find one of the dependencies
/usr/sbin/prelink: /usr/lib/pokerth-0.7.1/pokerth: Could not find one of the dependencies
/usr/sbin/prelink: /usr/lib/celtx/celtx-bin: Could not find one of the dependencies 
/usr/sbin/prelink: /usr/lib/googleearth/googleearth-bin: Could not find one of the dependencies
/usr/sbin/prelink: /usr/lib/kompozer/xpcshell: Could not find one of the dependencies
/usr/sbin/prelink: /usr/lib/kompozer/kompozer-bin: Could not find one of the dependencies
/usr/sbin/prelink: /usr/lib/kompozer/TestGtkEmbed: Could not find one of the dependencies
/usr/sbin/prelink: /usr/lib/torcs/torcs-bin: Could not find one of the dependencies 
/usr/sbin/prelink: /usr/lib/torcs/trackgen-bin: Could not find one of the dependencies
/usr/sbin/prelink: /usr/lib/torcs/texmapper-bin: Could not find one of the dependencies
/usr/sbin/prelink: /usr/lib/torcs/accc-bin: Could not find one of the dependencies   
/usr/sbin/prelink: /usr/lib/torcs/nfsperf-bin: Could not find one of the dependencies
Laying out 1268 libraries in virtual address space 41000000-50000000
Random base 0x44968000
/usr/sbin/prelink: Could not find virtual address slot for /usr/lib/grass64/lib/libgrass_sim.so
[root@localhost ~]#


AndrzejL

  • Guest
Re: Playing with Prelink
« Reply #7 on: September 18, 2010, 08:50:16 AM »
It should be:

Code: [Select]
dbus-launch kwrite /usr/bin/startkde
Rebooting.

Andy

Offline Texstar

  • Administrator
  • Super Villain
  • *****
  • Posts: 12662
Re: Playing with Prelink
« Reply #8 on: September 18, 2010, 08:53:04 AM »
It should be:

Code: [Select]
dbus-launch kwrite /usr/bin/startkde
Rebooting.

Andy

An advanced user would know that!  ;D

Thanks to everyone who donates. You keep the servers running.
Follow me on Twitter for the latest development info.

AndrzejL

  • Guest
Re: Playing with Prelink
« Reply #9 on: September 18, 2010, 08:57:02 AM »
It should be:

Code: [Select]
dbus-launch kwrite /usr/bin/startkde
Rebooting.

Andy

An advanced user would know that!  ;D

Sowwy... :P! Feel free to remove my post :D!

Can't prove it but it feels snappier...

Andy

EDIT: Woah... Was I just called an advanced user by Texstar himself?! WOW! ::) ::) ::) ::)
« Last Edit: September 18, 2010, 09:05:08 AM by AndrzejL »

Offline menotu

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 15515
  • ┌∩┐(◕_◕)┌∩┐
Re: Playing with Prelink
« Reply #10 on: September 18, 2010, 09:28:44 AM »
My KMenu opens really fast - it now opens immediately (before there was a very slight "hesitation") and Dolphin is opening folders with lots of files in them a lot quicker.

Useful little tweak.
PCLinuxOS 32bit KDE 4.10.4; kernel-3.4.11-pclos1.bfs & 64bit 3.4.38bfs; NVidia GeForce 8400GS 1GB 310.19 driver

Sony Vaio SVE1513A4ESI Laptop, Intel Core i5, 2.6GHz, 6GB RAM, 750GB, 15.6" Intel HD Graphics 4000

Offline Texstar

  • Administrator
  • Super Villain
  • *****
  • Posts: 12662
Re: Playing with Prelink
« Reply #11 on: September 19, 2010, 01:10:36 AM »
I can see the difference a lot more when launching applications in a non-kde desktop such as enlightenment.

Thanks to everyone who donates. You keep the servers running.
Follow me on Twitter for the latest development info.

Offline Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11689
  • ----IOFLU----
Re: Playing with Prelink
« Reply #12 on: September 19, 2010, 01:27:45 AM »
I can see the difference a lot more when launching applications in a non-kde desktop such as enlightenment.

Unless you changed something else in the last batch of upgrades, I just noticed, after running prelink and rebooting, that my GUI screen came back up on tty7 again, after being on tty8 since the earlier big batch of upgrades.  ???
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

Hootiegibbon

  • Guest
Re: Playing with Prelink
« Reply #13 on: September 19, 2010, 02:46:23 AM »
It should be:

Code: [Select]
dbus-launch kwrite /usr/bin/startkde
Rebooting.

Andy


An advanced user would know that!  ;D


Sowwy... :P! Feel free to remove my post :D!

Can't prove it but it feels snappier...

Andy

EDIT: Woah... Was I just called an advanced user by Texstar himself?! WOW! ::) ::) ::) ::)


Andy,

He wasn't saying that, what my interpretation would be is

Andy, an advanced user would know that, without resorting to a search first.... :) lol

I jest of course.

I have noticed an increase in responsiveness, cool stuff Texstar!  

EDIT further reading for those interested http://linux.die.net/man/8/prelink

Jase
« Last Edit: September 19, 2010, 03:26:51 AM by Hootiegibbon »

Offline menotu

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 15515
  • ┌∩┐(◕_◕)┌∩┐
Re: Playing with Prelink
« Reply #14 on: September 19, 2010, 03:52:05 AM »
Quote
EDIT further reading for those interested http://linux.die.net/man/8/prelink


Nice link Jase - many thanks
PCLinuxOS 32bit KDE 4.10.4; kernel-3.4.11-pclos1.bfs & 64bit 3.4.38bfs; NVidia GeForce 8400GS 1GB 310.19 driver

Sony Vaio SVE1513A4ESI Laptop, Intel Core i5, 2.6GHz, 6GB RAM, 750GB, 15.6" Intel HD Graphics 4000