Mail Archives: djgpp/1997/09/21/06:31:36
On Fri, 19 Sep 1997, Jan Hubicka wrote:
> And I was really surprised by result:
>
> DJGPP EMX
> cwsdpmi 5.00 0.38(rsx dpmi forced here)
> pmode 2.97 ----
> w/o DPMI ---- 0.16(emx extender)
> Win DOS 6.04 0.43
> Windows ---- 8.51(rsxwin extender)
> QDPMI 7.91 0.22(rsx dpmi forced here)
>
> Well, It looks like EMX is five times faster, wich is impossible IMO :)
> So I did tests at borland C and result is 0.93, wich is more that with
> EMX (and w/o any protected mode switches). So I did tests just for open/close
> calls (w/o any write) and result is:
>
> cwsdpmi 2.09 3.29
> pmode 1.59 ----
> w/O DPMI ---- 1.42
> Win DOS 2.09 3.63
> Windows ---- 6.81
> QDPMI 2.97 1.81
> bc 2.64
I don't get this. The second test was WITHOUT the loop that calls
`write', and it took LONGER to execute with EMX? How can that be??
First, if you test system calls, you should use functions which are
closest to the system call itself. In this case, this means you
should use `_open', `_close' and `_write', not the calls you used
which add overhead.
Second, even calling `_open' and `_close' is unfair comparison,
because DJGPP's versions waste some more time testing for LFN
support. (However, the run-time penalty for this shouldn't be
anywhere near the ratios that you see.)
Third, how about telling us what system and which configuration
(memory manager etc.) did you use? Many people which read this news
group probably won't have EMX/gcc installed, but at least the DJGPP
part could be verified, given enough information.
On my machine (a P166 with 64MBytes of main memory and running from
the DOS box on Windows 95), your program (with the write code
included) took 29.62 seconds when compiled with DJGPP and 26.37
seconds when compiled with BCC 3.1. This is an acceptable ratio,
since DJGPP moves data to conventional memory and thus is expected to
be slightly slower. Btw, the disk was not involved in my test (the
LED was off at all times) due to disk cache operation, so the disk
performance is not an issue here.
Forth, did you also measured the elapsed system time (e.g., by looking
at your watch, or by using the `redir's -t option)? If so, please
report elapsed times also. (Personally, I cannot believe that opening
a file 1000 times could take less than a second.)
And last, but not least, how would you explain the fact that the
measured time went UP (for EMX) when you deleted the code that writes
from your test program? IMHO, without a reasonable explanation of
this anomaly, the entire comparison is useless.
> So it looks like both bc and EMX
> uses some better way to do write call (buffered?) Maybe it should
> worth to implement it for DJGPP too :)
What buffered write call? `write' doesn't, and shouldn't, buffer
anything, it just passes the data to DOS without any buffering. (The
buffered call is `fwrite'.)
> BTW why under QDPMI is rsx faster?
QDPMI is known to be marginally faster than CWSDPMI. The difference
should not be as large as you report, though.
- Raw text -