Also, with todays chips if you "optimize" like that it will confuse the processor and your performance will drop faster than you can imagine. In fact, under linux I know (probably other OSes as well) you can't actually use the code segment as the data segment. Optimizing today is based on combining instructions in such a way that all the parts of the processor are fully utilized. I don't feel like getting into it, but if you are curious download the optimization manual off intel's website. One "high level" optimization thing is to make your code predictable. Branches are still the biggest performance killer (not counting waiting on non-memory data).
On Dec 16, 2007 9:19 PM, Heikki Levanto <[EMAIL PROTECTED]> wrote: > On Sat, Dec 15, 2007 at 03:00:02AM +1800, Nick Apperson wrote: > > > > In theory, and ONLY in theory, assembly is the fastest programming > > language. > > I do agree with most of what you said, but I have to squeeze in a comment > that assembly is not necessarily the most optimized way to write code, > when > it really comes to it. If you *really* have to go for it, you need to be > aware of the binary expression of every instruction... I have (once!) - > many > many years ago - optimized some assembly code where I reused the same > bytes > as instructions, jump offsets, and data, carefully placing the code on > the > right address so that this trick would work. This might have been possible > with a good assembler, but at that time I did no have one for that CPU, so > I > was working directly in hexadecimal. > > With modern processors, assemblers, and compilers, things are different. > And > today, nobody will take the time to optimize on that level - which is good > enough. But in theory... > > - Heikki > > > > > -- > Heikki Levanto "In Murphy We Turst" heikki (at) lsd (dot) dk > > _______________________________________________ > computer-go mailing list > computer-go@computer-go.org > http://www.computer-go.org/mailman/listinfo/computer-go/ >
_______________________________________________ computer-go mailing list computer-go@computer-go.org http://www.computer-go.org/mailman/listinfo/computer-go/