Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 23 Sep 2013 15:45:46 +0200
From: John Spencer <maillist-musl@...fooze.de>
To: sabotage@...ts.openwall.com
Subject: Re: Installing everything in opt

On 09/23/2013 02:36 PM, Christian Neukirchen wrote:
> Paul Schutte<sjpschutte@...il.com>  writes:
>
>> Hi Guys,
>>
>> I apologize in advance if I step on someone toes with this post.
>>
>> Performance wise it is very bad to put everything in /opt and using
>> symlinks.
>>
>> lets look at an example of a binary called test1 that uses three dynamic
>> libraries.
>>
>> In a "normal" installation it will go something like this:
>>
>> dirlookup(/bin)->inodelookup(/bin)->dirlookup(test1)->inodelookup(test1)->load(test1)
>>
>>
>> In the "symlink" installation it will go something like this:
>>
>> dirlookup(/bin)->inodelookup(/bin)->dirlookup(test1)->inodelookup(test1)->readsymlink(test1)
>> ->dirlookup(/opt)->inodelookup(/opt)->dirlookup(test1dir)->inodelookup(test1dir)
>> ->dirlookup(/bin)->inodelookup(/bin)->->dirlookup(test1)->inodelookup(test1)
>>
>> 5 operations vs 13 operations.
>>
>> If we take into account the 3 libraries we are at 20 ops vs 52.
>>
>> If we asume SATA with 8ms average seek, this will be 0.16s vs 0.416s seek
>> time for the same binary.
>>
>> One might argue that the meta data will be cached and therefore the penalty
>> is not that bad.
>
> It would be interesting to benchmark the actual performance loss,
> e.g. of a kernel build with toolchain in /usr vs symlinked.
>

yes, seeing some real-world performance numbers would be interesting.

i doubt that it makes a noticable difference, and it's gonna be much 
faster than a glibc based system either way, due to musl's 
syscall-optimized startup code.

btw, sabotage makes it really trivial to change the way packages are 
installed. if you don't want to use the one-package-per-dir strategy, 
and the flexible symlink management (butch unlink, butch relink, etc) 
you can edit KEEP/butch_template... and change the variables
butch_do_custom_destdir=true
butch_do_cleanup_custom_destdir=true
butch_do_relocate=true
to false.

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.