well, you need to ditch all those heavy GUI libraries to start with, those eat massive amounts of memory...
It's all a question of memory allocation, people just don't go the extra mile these days to think up memory structures to use minimal RAM.
Where are the days of using a single int to store 16 booleans?
jwenting
duckman
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
Programming for less waste also makes for faster programs.
Customers complain about programs being huge and slow, a main reason is the reasoning you portray that RAM and CPU cycles no longer matter.
They do. Maybe not to the extent they did 20 years ago but they certainly matter today.
DOS 3 ran on 384KB of RAM in a 4.77MHz CPU comfortably with enough left over to run a word processor or spreadsheet.
Today Windows XP struggles doing that when you have 384MB of RAM on a 2.5GHz CPU... That's 1000 times the memory and 500 times the CPU speed to run essentially the same functionality.
And guess what, that DOS program on that XT ran almost as fast as that bloated Windows program on that PIV.
I don't advocate leaving everything behind and going back to handcoding in ASM, but what I do advocate is to be aware of the RAM and CPU cycles your code uses and not to waste that.
Another example: a few years ago I was assigned to optimise a C++ application running on OS/2 on a P233. It needed to run once a day analysing a large amount of input data and generating a report over it.
There was a problem though, over time the data had grown and now the program needed 32 hours to complete it's daily run...
By doing a few simple optimisations like loop unrolling and inlining some small functions (one and two liners) I was able to get the program to complete in half the time on the same hardware (which at the time was, while not state of the art, certainly about average for what the customer was using).
One day of work on the part of one consultant saved them from buying a highend workstation.
Had the original programmer been more aware of the consequences of his design choices that expensive consultant (me) would not have been needed. The company would have saved my fee (about a thousand Euro for a day of work at the time) for maybe a few hours of one of their own people (at 50 Euro an hour or less).
And that isn't the only time some simple performance awareness in software design and implementations would have avoided major cost lateron.
jwenting
duckman
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
int main()
{
for (;;);
}
doesn't do much, doesn't use a lot of memory either :)
jwenting
duckman
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337