Subject: Re: speeding up ld.elf_so
To: <>
From: David Laight <david@l8s.co.uk>
List: tech-perform
Date: 08/26/2002 16:06:25
On Sun, Aug 25, 2002 at 11:54:01AM +1000, Luke Mewburn wrote:
> 
> Any clean solutions to improve the performance of dynamic program
> startup are generally welcome!

My changes gain about 3.75% for the following program:

int
main(int c, char **v)
{
	char *n = v[1];
	if (n)
		for (n += strlen(n); n != v[1];)
			if (--*--n != '0'-1)
				return execv(v[0], v);
			else
			    *n = '9';
	return 0;
}

Using "sh -c './x 999;ps -octime -p $$'" to measure the child time
of the shell - ie the execution time of 1000 execs of my test program,

/usr/libexec/ld.elf.so	1.663 seconds
/usr/libexec/test	1.596 seconds
/oldroot/usr/bsd-current/obj/libexec/ld.elf_so/ld.elf_so
			1.652 seconds
- note that the search time for the long directory is significant...

For comparison a static version takes 0.230 seconds.

	David

-- 
David Laight: david@l8s.co.uk