delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/09/14/14:52:57

Date: Sun, 14 Sep 1997 11:42:15 -0700 (PDT)
Message-Id: <199709141842.LAA12523@adit.ap.net>
Mime-Version: 1.0
To: ginsberg AT dt DOT cirl DOT uoregon DOT edu (Matthew L. Ginsberg), djgpp AT delorie DOT com
From: Nate Eldredge <eldredge AT ap DOT net>
Subject: Re: large app on a P5

At 03:07  9/12/1997 GMT, Matthew L. Ginsberg wrote:
>
>I'm trying to run two copies of a large app built using djgpp under
>dos, and it's only running at about half the speed that it runs under
>linux.  In addition, the swapping behavior seems much worse.
>
>The app does a tremendous number of small mallocs and frees, and it's
>also possible that I'm somehow producing 16-bit code under dos and
>32-bit code under linux.  Are these likely to be the source of the
>problem?  And if so, any suggestions as to how I might fix them?
You are quite definitely not producing 16-bit code. GCC couldn't if it
wanted to.
Swapping and disk access are likely to be much slower under DJGPP than
Linux. Reasons:
- DJGPP has to do a mode switch for disk access, while Linux stays in
protected mode always.
- DJGPP swaps to a file, which requires using DOS's file read/write calls,
which require file system stuff. Linux can swap directly to a partition.
- DOS does 16-bit disk access and does it through the BIOS, while Linux does
32-bit disk access and talks directly to the hardware.

Another possible problem: DJGPP's malloc is wasteful, though quite fast.
It's unknown if the unused memory is actually needed or not. You could
implement some other kind of dynamic memory, for instance use a growing
stack. (Disadvantage: It all has to be freed in order, or all together.)

Other than that, I don't know what you can do but live with it. Sorry.

Nate Eldredge
eldredge AT ap DOT net



- Raw text -


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