delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/09/19/04:44:30

Message-ID: <19970919110024.17908@horac.ta.jcu.cz>
Date: Fri, 19 Sep 1997 11:00:24 +0200
From: Jan Hubicka <hubicka AT horac DOT ta DOT jcu DOT cz>
To: djgpp AT delorie DOT com
Subject: Strange benchmark results
Mime-Version: 1.0

Hi
I was making some comparsions of EMX and DJGPP. I wanted to write test
to benchamrk speed of systems calls real interrupt and similiar stuff,
that depends at dpmi implementation/EMX extender. I wrote following simple
program to make 10000 times file aaaa, write there 100 bytes (unbuferred
one write call for each byte) and close:

#include <stdlib.h>
#include <time.h>
#include <sys/fcntl.h>
main()
{int i1=clock(),i2;
 int fd;
 int i;
 char buff[2]="a";
 for(i=0;i<1000;i++)
 { int y;
   fd=open("aaaa",O_WRONLY|O_BINARY|O_CREAT);
   for(y=0;y<100;y++)
     write(fd,buff,1);
   close(fd);
 }
 i2=clock();
 printf("%.2f\n",((double)i2-i1)/CLOCKS_PER_SEC);
}

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

This seems to be more close to normal results. BTW why under QDPMI is rsx faster?
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 :)

Honza
-- 
------------------------------------------------------------------------------
                   Have you browsed my www pages? Look at:
                       http://www.paru.cas.cz/~hubicka
      Koules-the game for Svgalib,X11 and OS/2,  Xonix-the game for X11
      czech documentation for linux index, original 2D computer art and
              funny 100 years old photos and articles are there!

- Raw text -


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