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" 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> Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=ISO-8859-1 X-Mailer: emacs 21.3.50 (via feedmail 8 I) and Blat ver 2.2.2 In-reply-to: (message from Carlo on Sat, 11 Dec 2004 14:55:08 GMT) Subject: Re: why inportb and outportb are so time expensive ? References: <01c4df88$Blat.v2.2.2$3e1f4700 AT zahav DOT net DOT il> 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 Precedence: bulk > From: Carlo > 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.