{"id":1199,"date":"2010-09-19T00:21:47","date_gmt":"2010-09-18T17:21:47","guid":{"rendered":"http:\/\/www.jfdesignnet.com\/?p=1199"},"modified":"2010-09-19T00:21:47","modified_gmt":"2010-09-18T17:21:47","slug":"speed-up-kde-with-elf-prelinking-was-linking-speed-for-c","status":"publish","type":"post","link":"https:\/\/www.jfdesignnet.com\/?p=1199","title":{"rendered":"speed up KDE with ELF prelinking (was: Linking speed for C++)"},"content":{"rendered":"<p><a href=\"http:\/\/www.jfdesignnet.com\/wp-content\/uploads\/2010\/09\/link-chain.jpg\" rel=\"lightbox[1199]\"><img decoding=\"async\" loading=\"lazy\" class=\"alignright size-medium wp-image-1202\" title=\"link-chain\" src=\"http:\/\/www.jfdesignnet.com\/wp-content\/uploads\/2010\/09\/link-chain-300x225.jpg\" alt=\"\" width=\"147\" height=\"114\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">Found today a free program named as <strong>prelink<\/strong> who written by Jakub Jel\u00ednek 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, so that one binary can prelink 32bit and 64bit ELF and some prelink cache management work (at the moment it prelinks one library at a time, the desired mode of operation is that it is given a list of library and list of binary directories and prelinks all suitable libraries found in the first set of directories and afterwards prelinks all binaries to those libraries). Here is the complete story on <a href=\"http:\/\/en.wikipedia.org\/wiki\/Prelink\">Wikipedia<\/a> and here is the <a href=\"http:\/\/people.redhat.com\/jakub\/prelink\/\">source<\/a>.<\/p>\n<p style=\"text-align: justify;\">Mozilla has been working on startup time improvements for Firefox 4 and Moz. developer Taras has a <a href=\"http:\/\/bit.ly\/901DfC\">blog<\/a> detailing it. He has mentioned prelink on numerous posts, and actually posts numbers for the startup time improvements afforded by prelink. Apparently, prelink alone saves 170ms (that&#8217;s about 1\/5 of a second or 8.5%) of firefox startup time.<\/p>\n<p style=\"text-align: justify;\"><strong> Actual results have been mixed<\/strong>, but it seems to aid systems with a large number of libraries, such as KDE. I checked with konqueror (konqueror is IMHO a typical example of application which has zillions of shared libraries and spents an awful lot of time in the dynamic linker) and it speeding up the load time very very fast. I&#8217;ve also noticed\u00a0 that my Firefox and Thunderbird are quicker to start on my system, Lancelot opens really fast &#8211; it now opens immediately (before there was a  very slight &#8220;hesitation&#8221;) and Dolphin is opening folders with lots of  files in them a lot quicker. Useful little tweak after this prelinking.<\/p>\n<p style=\"text-align: justify;\">Enough said, now here are the how to take advantage of this prelink program for KDE implementation :<\/p>\n<ul>\n<li>Install prelink from Synaptic Package Manager<\/li>\n<li>Open terminal konsole su to root and type <strong>prelink -avmR<\/strong><\/li>\n<li>While still in terminal edit \/usr\/bin\/startkde with your favorite text editor. Add the line highlighted in bold to startkde. {code}export KDE_NO_IPV6=True<br \/>\nexport KDE_USE_IPV6=&#8221;no&#8221;<br \/>\n<strong>export KDE_IS_PRELINKED=1<\/strong> {\/code}<\/li>\n<li>Save the file and exit.<\/li>\n<li>Reboot and see if your applications launch faster.<\/li>\n<\/ul>\n<p style=\"text-align: justify;\"><span style=\"text-decoration: underline;\"><strong>Security  Bonus:<\/strong><\/span> 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.<\/p>\n<p style=\"text-align: justify;\"><span style=\"text-decoration: underline;\"><strong>Discrepancies :<\/strong><\/span><\/p>\n<p style=\"text-align: justify;\">In case there were some discrepancies, because somehow I got some complaining from the klixs user which I cannot replicate on mine :<\/p>\n<blockquote>\n<p style=\"text-align: justify;\">Tried putting things in dropbox shortly after running prelink and  nothing would upload from the local box to dropbox online. Did a  reinstall of dropbox and it now works again.<\/p>\n<\/blockquote>\n<p>Disabled the issue library using blacklist parameter in \/etc\/prelink.conf, such as this if you want to blacklist the dropbox lib :<\/p>\n<p>{code}-b \/usr\/lib\/dropbox-dist{\/code}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Found today a free program named as prelink who written by Jakub Jel\u00ednek 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, so that one binary can prelink 32bit and 64bit ELF and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1202,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[184],"_links":{"self":[{"href":"https:\/\/www.jfdesignnet.com\/index.php?rest_route=\/wp\/v2\/posts\/1199"}],"collection":[{"href":"https:\/\/www.jfdesignnet.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jfdesignnet.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jfdesignnet.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jfdesignnet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1199"}],"version-history":[{"count":0,"href":"https:\/\/www.jfdesignnet.com\/index.php?rest_route=\/wp\/v2\/posts\/1199\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.jfdesignnet.com\/index.php?rest_route=\/wp\/v2\/media\/1202"}],"wp:attachment":[{"href":"https:\/\/www.jfdesignnet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1199"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jfdesignnet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1199"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jfdesignnet.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1199"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}