Subject: Re: CVS commit: basesrc/libexec/ld.elf_so
To: None <junyoung@netbsd.org>
From: Simon Burge <simonb@wasabisystems.com>
List: source-changes
Date: 12/06/2002 12:52:42
Bang Jun-Young wrote:

> Module Name:	basesrc
> Committed By:	junyoung
> Date:		Thu Dec  5 04:56:57 UTC 2002
> 
> Modified Files:
> 
> 	basesrc/libexec/ld.elf_so: load.c map_object.c rtld.c rtld.h
> 
> Log Message:
> 
> A bit speedup: in _rtld_load_object(), save the number of calls to
> strcmp() by performing path name length comparison first. In the test
> with Mozilla, the number was reduced to 1068 from 7182 (yes, we saved
> 6114 strcmp()!).

I'm a little curious how much faster this change is...

From the diff, it seems we now unconditionally strlen() each path which
means that the full length of the path is read and checked (looking for
the NUL byte) instead of the strcmp() stopping at the first different
byte.  What was the number of strlen() calls before and after this
change?  Maybe also interesting would be the average path length...

Simon.
--
Simon Burge                            <simonb@wasabisystems.com>
NetBSD Support and Service:         http://www.wasabisystems.com/