[aklug] Re: A developer's take on system resource consumption

From: Christopher Howard <christopher.howard@frigidcode.com>
Date: Sun Jun 12 2011 - 15:36:33 AKDT

On 06/12/2011 12:34 PM, Arthur Corliss wrote:
>> Second, there is a flip side to the memory issue -- performance. We put
>> stuff in memory so that we have instant access to it. The more memory we
>> have, the more freedom we have to do this.
>
> While that's true, that still doesn't ask the question about whether our in
> memory structures are as efficiently organized as possible, nor, I'd wager,
> does the average developer worry about whether they're keeping something in
> memory that has a high utilization enough to make it worth the consumption
> of resources. Instead they gratuitiously allocate blocks of memory just
> because a) it's easier, and b) the average system has gigabytes of memory so
> what's a few more megabytes?
>
> Ironically, such practices can actually hurt application performance. Poor
> memory organization and too many lightly used variables can destroy cache
> coherency on a single-threaded system, and magnitudes worse on a system
> doing real world multitasking. How many developer benchmarks and metrics
> are gathered on a dedicated single-threaded system? Damned near all, I'd
> bet. (Note: when I say single-threaded I'm talking about not running
> concurrent and diverse application processes, not whether an application
> itself is threaded or not).
>

Interesting discussion. Maybe, though, we should step away from
philosophy and focus on specifics. To be honest, I'm not qualified
address the issue of memory management in C/C++ and similar languages,
because I don't (and won't) program in them anymore. I'm getting pretty
strongly hooked on Haskell now, and it is quite a different bear. In
Haskell, at least, you don't allocate memory or assign variables, per
se: rather, you focus on writing functions that need to "remember" as
little of the data/calculation as possible in order to return a result,
and then you tweak the compiler options to produce the best code. Space
leaks are a serious issue, but are (from what I've read) usually common
technical mistakes that have been well addressed by the community.
Here's a link with some examples, if you are interested:

http://blog.ezyang.com/2011/05/space-leak-zoo/

It is a bit speculative, I suppose, but I think if someone ever got
around to writing a new Web browser in a functional language, it would
be the coolest and most powerful browser ever written. Wouldn't mind
jumping on that project myself, if there wasn't /so much/ involved
(changing Web standards, malformed HTML, DOM, javascript integration, et
cetera et cetera) But maybe I will someday.

>
> I don't know, maybe I just scarred from having to plug in 16KB RAM bricks
> onto the back of my home computer as a child.

He said it, not me... ;)

-- 
frigidcode.com
theologia.indicium.us
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Sun Jun 12 15:36:15 2011

This archive was generated by hypermail 2.1.8 : Sun Jun 12 2011 - 15:36:15 AKDT