www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/19/11:38:08

Message-Id: <m0z9ACv-000S4xC@inti.gov.ar>
Comments: Authenticated sender is <salvador AT natacha DOT inti DOT gov DOT ar>
From: "Salvador Eduardo Tropea (SET)" <salvador AT inti DOT gov DOT ar>
Organization: INTI
To: oohoseoo AT aol DOT com (OoHOSEoO), djgpp AT delorie DOT com
Date: Wed, 19 Aug 1998 12:42:46 +0000
MIME-Version: 1.0
Subject: Re: system() bloat! what's going on?
In-reply-to: <1998081521243700.RAA18260@ladder03.news.aol.com>

oohoseoo AT aol DOT com (OoHOSEoO) wrote:

> I just checked a program I recently compiled and found it's size to be
> abnormally high.  After looking through the source I found that it was due to
> the system() functions.. after commenting the system() function out the code
> what a nice 38k, with the system() function in the code it was damn near double
> that! 72k.  A friend told me that it may be related to the overhead necessary
> to switch back into real mode.  So what's the story.. and is there a way to
> reduce this?  After all, I could probably just write the function that performs
> the same as the program I am calling through system().

I think you must take a look to the system help in the libc help (if you are 
using RHIDE just put the cursor over the call and press Ctrl+F1). After 
reading it you'll realize that system isn't just a call to the DOS' exec 
service. If you still in doubts just take a look to the sources.

There are a lot of "magic" inside system to call other DJGPP programs passing 
hyperlong command lines, calling a shell for scripts, avoiding command.com 
for silly requests, etc, etc.

If you can do it in your code avoid calling an external program. DOS isn't 
UNIX and calling another program costs too much in terms of performance and 
resources.

SET
------------------------------------ 0 --------------------------------
Visit my home page: http://set-soft.home.ml.org/
or
http://www.geocities.com/SiliconValley/Vista/6552/
Salvador Eduardo Tropea (SET). (Electronics Engineer)
Alternative e-mail: set-soft AT usa DOT net set AT computer DOT org
ICQ: 2951574
Address: Curapaligue 2124, Caseros, 3 de Febrero
Buenos Aires, (1678), ARGENTINA
TE: +(541) 759 0013

- Raw text -


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