About computer instruction in relation to RAM consumption

Started by
32 comments, last by cgrant 9 years, 3 months ago

With most hardware now being out of order components writing your own asm is not that much of a win anymore, compiler technology also has come a long way over the last 25 years and most compilers are better at transforming your code into asm then you are. Whilst you should know things about memory and cpu workings I don't think asm is the right way to start learning about programming.
Not every coder has to know about the nitty gritty of the CPU an overall understanding like the article linked earlier will give you enough understanding to be able to make optimizations in any language. Starting in a managed language is perfectly fine, learning algorithm construction is the goal before learning to optimise your code and dealing with all the hardware problems.

It's not so much about outdoing your compiler (which I would not even dare to attempt in these days), but rather to get a grasp on how and why higher languages work like they do. Things seem more logical and easier to get when you know the basics, at least that's how it worked for me.

Not to say that you shouldn't do some BASIC or Python first to get an idea on what a computer program even is.

-- I agree not every coder needs to know the nitty gritty, however Warnexus specifically stated that was his aim.

Advertisement

Other games will run simulations/animations as fast as possible and consume 100% CPU and that is perfectly normal.

Won't that overheat or overwork the CPU or reduce the lifespan of a CPU if it processing a lot of data at that level?


It used to be the accepted norm to push your CPU to its limits, but recently PETA has started raising awareness for this kind of mistreatement of computing devices. It is only a matter of time, until they have gathered sufficient support to take legal action against those that still abuse their CPUs. Intel has already caved to the pressure by introducing the special _mm_pause intrinsic which implements the legally mandated rest breaks.

If you do need to push your CPU to 100% on a regular basis, make sure you introduce a day of rest at least twice a week and allow for at least 20 days of payed vacation per year.
If you do need to push your CPU to 100% on a regular basis, make sure you introduce a day of rest at least twice a week and allow for at least 20 days of payed vacation per year.

You in the labour union or what!? Begone! laugh.png

Seriously though:

Of course running at 100% CPU does wear down the CPU. It will break after approximately 10-15 years.

Overclocking will reduce this time, and underclocking (which includes going into power save state) will prolong it. This is a property of most technical things (engines, lamps, and yes... CPUs as well).

Mind the famous movie quote "A light that burns twice as bright burns half as long", except the truth is much closer to: a light that burns 10% brighter burns 1/10 as long.

But do you really care about whether your CPU lasts longer than 25 or 30 years? It's unlikely that your harddisk will live that long, and what do you do with a 30 year old computer without 30 year old software?


Although it may look attractive to jump into the deep and quickly get a feel of moving towards your dream, it will not help you to actually become a proficient game programmer. That's why I always - sometimes against popular belief - recommend to start out with raw assembly (preferably on a 65xx emulator or DOS in real mode) and then move up to C or any other compiled language, and finally move to scripted languages. That way you can see all the way down at any stage and really know what's going on under the hood.

You have not learned to appreciate how computers work until you have smelled the rosin core of your solder.

Seriously, there are really good hands-on ways to understand the basics of a computer. Be forewarned, this can be a (worthwhile) time an money sink.

Stephen M. Webb
Professional Free Software Developer


Although it may look attractive to jump into the deep and quickly get a feel of moving towards your dream, it will not help you to actually become a proficient game programmer. That's why I always - sometimes against popular belief - recommend to start out with raw assembly (preferably on a 65xx emulator or DOS in real mode) and then move up to C or any other compiled language, and finally move to scripted languages. That way you can see all the way down at any stage and really know what's going on under the hood.

You have not learned to appreciate how computers work until you have smelled the rosin core of your solder.

Seriously, there are really good hands-on ways to understand the basics of a computer. Be forewarned, this can be a (worthwhile) time an money sink.

I guess I'm just missing the black magic of entering hex-codes by lack of a proper assembler. There's nothing like having to keep the addresses of your subroutines on a piece of paper. *grin* But my views might be way outdated, I don't know. They probably are.

Jon von Neuman is probably rolling in the grave from this question. However, as basic as is seems to most of us, to the OP I would recommend getting some form of literature focused on the basics of computing. How computer works, how programs work, how numbers are represented etc, then move on to more advance info.

This topic is closed to new replies.

Advertisement