delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2002/10/26/04:35:24

Date: Sat, 26 Oct 2002 10:32:26 +0300
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
Sender: halo1 AT zahav DOT net DOT il
To: "Leonid Pauzner" <uue AT pauzner DOT dnttm DOT ru>
Message-Id: <2593-Sat26Oct2002103225+0200-eliz@is.elta.co.il>
X-Mailer: emacs 21.3.50 (via feedmail 8 I) and Blat ver 1.8.9
CC: djgpp-workers AT delorie DOT com
In-reply-to: <2.7.9.ZOFT.H4JNYR@pauzner.dnttm.ru> (uue@pauzner.dnttm.ru)
Subject: Re: _use_lfn() and _preserve_fncase() implementation
References: <2 DOT 7 DOT 9 DOT ZOFT DOT H4JNYR AT pauzner DOT dnttm DOT ru>
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> From: "Leonid Pauzner" <uue AT pauzner DOT dnttm DOT ru>
> Date: Fri, 25 Oct 2002 19:49:39 +0400 (MSD)
> 
> I found out that _use_lfn() have non zero weight, according to the profile:
> 
> 
>                 0.00    0.00      27/40929       _chmod [208]
>                 0.01    0.00    4070/40929       _truename [62]
>                 0.01    0.00    4088/40929       _fixpath [36]
>                 0.01    0.00    4090/40929       __findfirst [66]
>                 0.01    0.00    4115/40929       __findnext [129]
>                 0.03    0.02   24497/40929       _lfn_gen_short_fname [95]
> [58]     0.6    0.06    0.03   40929         _use_lfn [58]
>                 0.03    0.00    4090/8256        getenv [79]
>                 0.00    0.00    4089/4089        _get_volume_info [323]
> -----------------------------------------------
> 
> I wonder why _use_lfn repeatedly calls getenv() and _get_volume_info().

This happens because some functions call _use_lfn with a file name
while others pass it a NULL argument.  Look in the archives of this
list, this issue has been discussed in the past (perhaps a year ago?),
and then read the source of _use_lfn to see what goes on.

> Not a big overhead but could this be improved?

Maybe.  IIRC, _use_lfn is tricky and took several iterations to get
right.  You could give it a try if you care about the small overhead.

> Function calls with 0 arg ( _USE_LFN macro)
> mixed with nonzero arg from __fixpath()

This is okay in general; see above.

> Also, numerous getenv() calls occured from _preserve_fncase()
> which called in turn from _fixpath().

_preserve_fncase could be also improved to take advantage of the
__environ_changed feature.  But I think the code from CVS makes the
number of calls to _preserve_fncase even smaller, so perhaps we
shouldn't care about that.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019