www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/09/24/11:02:55

Date: Wed, 24 Sep 1997 17:02:32 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Mike Darrett <ez073236 AT mailbox DOT ucdavis DOT edu>
cc: djgpp AT delorie DOT com
Subject: Re: question about bios/msdos speed
In-Reply-To: <Pine.GSO.3.95.970923194832.22979A-100000@dogbert.ucdavis.edu>
Message-ID: <Pine.SUN.3.91.970924165855.19351D-100000@is>
MIME-Version: 1.0

On Tue, 23 Sep 1997, Mike Darrett wrote:

> 	I need to write a program that has *frequent* disk access, i.e. it
> reads pieces of a MASSIVE data file, using fseek() to get to the regions 
> it needs.

How massive is the file? If you need to seek a lot, maybe it's better to 
read it all into memory?  In DJGPP, you can read a few megabytes without 
risking slow-down due to VM paging on most machines.

> The question is, since I am assuming the msdos file io commands
> are in real mode, does this pose a problem to djgpp's 32-bit protected
> mode, i.e. will the cpu be switching back & forth bet. real/protected
> mode? This is slow, correct?

If you read the file in large chunks, it is not so slow as you might 
think.  Try a simple benchmark and see for yourself.

> Will using PMode instead of CWSDPMI be any help?

Not really.  Most of the overhead of the mode switch is NOT due to 
DPMI host internals.

- Raw text -


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