delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/06/11/19:47:33

From: "Yury A. Zaitsev" <yurick AT oblik DOT dp DOT ua>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: __djgpp_map_physical_memory - some questions
Date: Mon, 11 Jun 2001 20:49:55 +0300
Organization: Apex NCC Public InterNet News Server
Lines: 35
Message-ID: <3c03g9.v17.ln@nix-if1>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 1010606090422 DOT 14278F AT is>
NNTP-Posting-Host: dialup66.apex.dp.ua
X-Trace: main.apex.dp.ua 992300744 1887 195.24.139.66 (11 Jun 2001 23:05:43 GMT)
X-Complaints-To: abuse AT apex DOT dp DOT ua
NNTP-Posting-Date: 11 Jun 2001 23:05:43 GMT
User-Agent: tin/1.5.8-20010221 ("Blue Water") (UNIX) (Linux/2.2.19 (i686))
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Wed, 6 Jun 2001, Eli Zaretskii <eliz AT is DOT elta DOT co DOT il> wrote:

>>        But IMHO djgpp works better under windoze dos session, not under 
>> dosemu :(, isn't it? 
EZ> I wasn't thinking about DOSEmu.
   So, Win9x DOS box is the best environment for DJGPP, isn't it?

>> Why time() is so _incredible_ slow? 100 000 calls of dj's time() takes 
>> about 4-5 seconds on the my Cel900 (win95osr2)! I thinked that 
>> this is because time() is so complex but under linux (glibc 2.1)
>> about 10 000 000(!) time() calls also takes about 3-4 seconds...
>> So djgpp's time() is about 100 times slower than linux's time() :(.
EZ> If you look into the sources, you will see that the DJGPP version calls 
EZ> DOS (twice) to get the system date and time.  Calling a real-mode 
EZ> interrupt from a protected-mode program has a huge overhead, due to the 
EZ> need to switch the CPU from protected to real mode and back.
   Yes, sources looks pretty simple - there are two calls of int21 and
a small piece of code...
   I've tested time() speed with Borland C++ and it's about 3 times faster
than dj's version. But is is slow anyway if I compare it with Linux... :(
Is DOS _really_ so slow?

>>     I has been forced to use clock() (which works fast) instead of time()
>> because I need to call it many times...
EZ> Why do you need to call `time' many times?  It's unusual that a program 
EZ> should need that.
   Do you know a _portable_ way to check timeouts? Time() (or gettimeofday())
is portable and fast (under Linux, for example ;). So, program looks 
like this:
--------------------------------------------------
while (!timeout()) {
   if (do_a_piece_of_work()==SUCCESS) break;
}
--------------------------------------------------

- Raw text -


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