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

List:       kde-optimize
Subject:    Re: comments on KDE performance tips
From:       Roger Larsson <roger.larsson () norran ! net>
Date:       2003-01-17 7:28:24
[Download RAW message or body]

On Friday 17 January 2003 06:34, Andrew Morton wrote:
> 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).

Not for me. It slows it down.
Maybe I have too little memory, or too much debug info in my files.
(full debug compiled)

But loading all small can be a great win... a little program that lists all
shared memory for all programs.

cat /proc/*/maps  | sort --key=6 -u | sort -n --key=5 | awk 
'BEGIN{limit=131072}
; {if ($5 > limit) {print total; limit *= 2}; total += $5; printf "% 7s %s %s 
%s
 %s\n", $5, $2, $3, $4, $6}; END{print total}'

My final lines read:
2535865 r-xp 00000000 03:07 /opt/qt-copy/plugins/imageformats/libqjpeg.so
2536861 r-xp 00000000 03:07 /opt/qt-copy/plugins/imageformats/libqmng.so
2747510 r-xp 00000000 03:07 /usr/lib/GL/libGL.so.1.3.mesasoft
2748112 r-xp 00000000 03:07 /opt/kdecvs/lib/kde3/plugins/styles/keramik.so
168685464

/RogerL

-- 
Roger Larsson
Skellefteċ
Sweden

_______________________________________________
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