delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2004/12/11/11:38:00

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
Date: Sat, 11 Dec 2004 18:36:49 +0200
From: "Eli Zaretskii" <eliz AT gnu DOT org>
Sender: halo1 AT zahav DOT net DOT il
To: djgpp AT delorie DOT com
Message-ID: <01c4df9f$Blat.v2.2.2$c21b9c40@zahav.net.il>
X-Mailer: emacs 21.3.50 (via feedmail 8 I) and Blat ver 2.2.2
In-reply-to: <gTDud.16862$Lg7.531795@twister1.libero.it> (message from Carlo
on Sat, 11 Dec 2004 14:55:08 GMT)
Subject: Re: why inportb and outportb are so time expensive ?
References: <b3Aud.18735$Zk DOT 327000 AT twister2 DOT libero DOT it> <01c4df88$Blat.v2.2.2$3e1f4700 AT zahav DOT net DOT il> <gTDud.16862$Lg7 DOT 531795 AT twister1 DOT libero DOT it>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> From: Carlo <mail AT bo DOT uf>
> Date: Sat, 11 Dec 2004 14:55:08 GMT
> 
> My application runs on a dos machine (MS-Dos 6.0) with a i386sx 
> processor @ 33 Mhz clock, with cwsdpmi r5.
> One program loop takes about 1 mSec, 75% of this millisecond spent for 
> inportb and outportb (with an average of 30/40 calls to that functions). 
> Without any of these calls the program runs up to 10 times faster.

Like DJ said: make sure you are compiling with optimizations to get
the in/outportb functions inlined, then compare the results (e.g., 20
microseconds per call if the results above are still valid) with the
speed of your bus (for 33MHz clock, it's usually 8MHz, but there could
be wait states) and the speed of the hardware you are reading and
writing to.

- Raw text -


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