|
From: | Fred Kiefer |
Subject: | Re: reducing memory usage |
Date: | Sun, 28 Dec 2003 16:38:19 +0100 |
User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030821 |
reuss wrote:
hos to optimize gnustep programs? I wrote 2 versions: first in plain objective-c the other one (with the same functionality) in gnustep; the first used 770 kb of memory, the second one 5700 kb. How to reduce the difference that annoys me a bit?
Hi Andras,the best way to answer your question is surely to point you to the original articels that Brad Cox did publish to describe the Obective-C language and his concept of Software ICs. At that time memory usage was an actual concern for most people, so he had to explain why he came up with a language that did require so big libraries. If you are still able to get hold of this read it, if not carry on with my explaination.
Why does memory matter to you at all? I would bet, that it doesn't. Todays computer carry a lot more memory than any serious user needs. (I am not talking about computer games here, they have allways been different) So most likely you just noticed, that one process uses more space than the other and want an explaination for this. Of course you did not write an application that uses 770 KB. I just checked the executable of Ink.app has 58 KB. So why is your application that much bigger when loaded into memory? Not just your application is loaded but also a whole bunch of dynamic libraries. And the same is true for a GNUstep application, when loaded Ink.app uses about 8 MB, which of course sounds like a lot, but why care? A similar KDE application uses about 25 MB. Your problem is, that your applicaiton uses none of the extra functionality, that comes with these libraries. Yes, in this case it is better not to link with them. You don't make an application a GNUstep applciation just for the sake of GNUstep. Normaly you want some of the functionality (very rarely all of it, but often quite a bit more than you realize in the beginning), that comes with GNUstep. Of course you could write all of this yourself and hand optimize it for the specific case, but would this be worthwhile? Surely not.
There may be a few places in GNUstep, where we waste space and time. If you find one of them go ahead and fix them (or report a specific bug). The overall idea of providing two libraries (Foundation and AppKit), that package up different functionality, is sound.
[Prev in Thread] | Current Thread | [Next in Thread] |