delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/20/22:16:56

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: large file
Date: Mon, 20 Oct 1997 18:59:31 +0000
Organization: Two pounds of chaos and a pinch of salt
Lines: 42
Message-ID: <344BAA13.4B0E@cs.com>
References: <877371682 DOT 4685 AT dejanews DOT com>
Reply-To: fighteer AT cs DOT com
NNTP-Posting-Host: ppp226.cs.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Simon DOT zalar AT guest DOT arnes DOT si wrote:
> 
> I have another question: if i make a "Hello World"
> program it is about 100kb large. I use V2.01 and rhide
> What can I do to make this better?

This is another FAQ.  In DJGPP, there is a tremendous amount of overhead
involved in setting up protected mode, reading command line parameters,
loading the DJGPP environment, installing interrupt handlers, handling
Windows 95 long filenames, etc... all of which is wasted if you just
want to print a handful of characters to the screen and exit.  This is
even more true if you write a "hello world" in C++.

The FAQ contains detailed information on program size and how to reduce
it in chapter 8.15.

> Another Question is: what is really better in protected
> mode? Is graphics much faster? How is DJGPP's speed
> compared with other compilers like Borland, Watcom?

DJGPP tends to compile more slowly than those others, simply because it
has to load an individual program for each compiler pass.  If you run it
from Win95, the disk cache usually eliminates most of this loss.

Apart from that, DJGPP generally produces better, faster, and smaller
code than any other _32-bit_ compiler, once you eliminate the overhead I
mention above.  Its memory signature is significantly smaller than most
other compilers.  Graphics run phenomenally well; check out Allegro to
see the perfect example.  But you need to unlearn a lot of old 16-bit
habits to get your code to work in DJGPP.

For small tasks, 16-bit compilers are almost always better, because they
involve so much less overhead.  But the larger your task, the better
suited DJGPP is to it.

-- 
---------------------------------------------------------------------
|      John M. Aldrich       | "Sin lies only in hurting other      |
|       aka Fighteer I       | people unnecessarily.  All other     |
|   mailto:fighteer AT cs DOT com   | 'sins' are invented nonsense."       |
| http://www.cs.com/fighteer |                 - Lazarus Long       |
---------------------------------------------------------------------

- Raw text -


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