delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/08/17/12:14:18

Date: Fri, 17 Aug 2001 19:13:17 +0300
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
Sender: halo1 AT zahav DOT net DOT il
To: "Matthew Conte" <matt AT conte DOT com>
Message-Id: <8011-Fri17Aug2001191316+0300-eliz@is.elta.co.il>
X-Mailer: Emacs 20.6 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.9
CC: djgpp-workers AT delorie DOT com
In-reply-to: <002d01c1270c$9bf80ca0$e33e1d18@nycap.rr.com> (matt@conte.com)
Subject: Re: Fstat.c patch
References: <003001c12702$4df56430$0a02a8c0 AT acceleron> <4331-Fri17Aug2001131335+0300-eliz AT is DOT elta DOT co DOT il> <002d01c1270c$9bf80ca0$e33e1d18 AT nycap DOT rr DOT com>
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: "Matthew Conte" <matt AT conte DOT com>
> Date: Fri, 17 Aug 2001 07:06:01 -0400
> 
> From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
> 
> > This is okay, but please take the call to _my_ds out of the loop.
> > Instead, call it once, and then use the result in the loop body.
> 
> isn't _my_ds just an inline function that will expand to one
> instruction

Only if you compile with optimizations.  Also, isn't a move from a
segment register slower than from a general-purpose register?

> (and won't require possibly temporary stack space to save
> in a temp variable) ?

I'd expect that variable to go into a register, since it's used
inside a loop.

Note that this code is part of `fstat', which is already quite
expensive.

Anyway, this is a minor point.  I didn't meant to say that there's
some gross inefficiency here.  It just doesn't seem clean to me to hav
a function call inside a loop, when we know that its return value is
constant.

- Raw text -


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