[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-optimize
Subject:    Re: comments on KDE performance tips
From:       Andrew Morton <akpm () digeo ! com>
Date:       2003-01-17 5:34:01
[Download RAW message or body]

Waldo Bastian <bastian@kde.org> wrote:
>
> I think it is possible to let the linker tell the kernel that the whole thing 
> should be read, but that's a suboptimal solution in that you read a lot of 
> stuff you rather not read. The best solution is to read what you need in one 
> go, and nothing of the stuff that you don't need. Such solution would mean 
> that you put all the stuff that you need (at startup) in one continguous part 
> of your lib and then the (runtime) linker should tell the kernel that it must 
> read all that in.

The cost of reading all the blocks in a file is negligibly higher than
reading (say) half of them.

For example, this script:

	#!/bin/sh
	PROG=$(which $1)
	for lib in $(ldd $PROG | cut -d ' ' -f 3)
	do
	        cat $lib > /dev/null
	done
	$*

when used as

	./launch.sh konqueror

speeds up the initial launch of konqueror by maybe 2x (didn't bother benching
it too hard, but the difference is quite plain).

And it's reading all the debug info and other ELF gunk.  Clearly, performing
an MADV_WILLNEED against the entire executable/library as soon as it is
mapped will speed things up significantly.  It's saving a ton of seeks.

As the amount of memory and disk bandwidth continue to increase, and the
latency of disk seeks and rotation fails to keep up, demand paging just makes
less and less sense.

_______________________________________________
Kde-optimize mailing list
Kde-optimize@mail.kde.org
http://mail.kde.org/mailman/listinfo/kde-optimize
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic