[Tfug] Cheap Memory

John Gruenenfelder johng at as.arizona.edu
Mon Dec 17 21:18:43 MST 2007


On Mon, Dec 17, 2007 at 07:38:18PM -0700, Terence Rudkin wrote:
>On Dec 17, 2007 6:22 PM, keith smith <klsmith2020 at yahoo.com> wrote:
>>
>> That is how most will look at the statement of "It only has 1GB of RAM.".
>>
>> There is another school of thought.... if a techie cost upwards of $100/hr in a w2 situation and a Gig of ram cost $59 or so and if a little RAM can overcome some long hours optimizing code.... lets throw some RAM at it.
>>
>> So what are your thoughts?

I realize I come from a different perspective here than many of the older
TFUGers (though, as my impending 10-year high scool reunion reminds me, 29 is
older than I would like), but even in my experience, efficiency is important to
consider.

First, the Comp sci. department here (UMass Amherst), has mentioned on more
than one occasion the importance of writing efficient code.  But, at the same
time, this is balanced with the need to get it done quickly.  For example,
let's say I work for company X, and all they really care about, deep down, is
getting the *work* done.

If I write four programs in Java, versus two programs in C/C++, that take the
same amount of time to run (each doing the same amount of work), then clearly
Java has won.  This is despite the fact that Java uses (much) more memory than
C/C++.  But the work is what is important.  I still write most of my code in
C/C++, but I'm not above admitting that Java usually results in getting the
job done faster (coding time, not execution time).  I still write in C/C++
because most of what I need doing depends on speed of execution and not speed
of development.

That said, I have also written a lot of software for satellites.  Really,
honest to god satellites.  Unfortunately, the first and only of these to
attempt go into space resulted in a crater in the Khazakistan desert, but the
lessons are still well learned.

( Note:  The crash is most certainly blamed on the Russians, not me.  :)  )

In this case, both memory and execution time are at an extreme premium.  I
don't doubt that the average CS graduate would do poorly under these
circumstances.  I am happy that I did as well as I did (under test
circumstances, obviously).

But, in the grand scheme of things, where is time best spent?  If you train
100 programmers to write decent, but not particularly efficent, code on modern
hardware, is that not better than training/educating 10 programmers to write
very good and very efficient code?

I'm not sure where I lie on that continuum.  I, personally, feel that I write
efficient code, bolstered by the fact that I have coded extensively for low
memory and under-powered systems (satellites and Palm OS, among others).  But
where would I rank compared, as an extreme example, with somebody who
originally coded on a PDP-11?  I'm not sure.  There, resources were at an
definite premium.  I'm not sure I would have measured up even with my satellite
experience, since, in this case, CPU time was (relatively) abundant even if
memory was not.

Many of us are tempted to point out how bloated Firefox or OpenOffice are,
just to pick some examples.  And there is certainly a lot of truth to that.
It is important to remember how much memory is used by caching to overcome
hardware inefficiencies, but even then many programs are inefficient.  But are
they so bloated as to render them unusable or worthy of scorn?  Probably not.
While I wish they were more efficient, I still use them every day.

I guess what I'm trying to say is that work accomplished does not necessarily
equal code efficiency.  While the latter matters, it is the former which is
most important.


-- 
--John Gruenenfelder    Research Assistant, UMass Amherst student
                        Systems Manager, MKS Imaging Technology, LLC.
Try Weasel Reader for PalmOS  --  http://gutenpalm.sf.net
"This is the most fun I've had without being drenched in the blood
of my enemies!"
        --Sam of Sam & Max




More information about the tfug mailing list