#6347 - Jason Wilkins - Fri May 23, 2003 4:39 pm
I want to get people's opinions about using floating point on the GBA.
A lot of people just outright say 'do not use it!' because it is slow. But, the problem with the words 'slow' and 'fast' is that speed is relative. You have to qualify. Too slow for what? Fast enough for what?
One example where it would save space, and not be too slow, would be to use it to build lookup tables at startup. It would save space to fill in a fixed point cosine lookup table at runtime using floating point operations than to store it in ROM. That is, assuming you want that fixed point table to be in RAM for speed purposes.
If a calculation only needed to be done once per frame, on only a few numbers, then it may be worth the ease of understanding and extended accuracy to use floating point.
Prototyping code is much easier to do if you do it in floating point first, then convert a little bit at a time to fixed point. I remember trying to help out someone who was having trouble just getting the calculations correct and the first thing I told them was to use floating point until it worked. They were using fixed point, and it was hard to know which was wrong, the fixed point arithimetic or the algorithm.
I heard someone go so far as to say that the math.h library was useless. I find it hard to believe that that is true. It could not possibly be so slow that you could not use it a few times per frame. It may be fast enough, and save thousands of bytes worth of lookup tables.
The biggest problem with floating point's speed is that by default, libgcc (which implements software floating point) and libm.a (the math library) are put into ROM. I plan on writing a tool which will allow these libraries to be placed in different sections.
The main point of this rant is that I am tired of hearing people say 'do not use floating point', because for beginners, it can be very hard to get both the algorithim and the fixed point math correct at the same time. There are many reasons to use floating point, even if you eventually optimize it away.
I would be less offended, perhaps, if someone would point beginners at a good C++ implementation of a fixed point class. Instead, most recommendations are just a flat rejection with an opaque exortation to use fixed point.
I have a C++ class that was good enough that I could add a '#define float fix' to my header files and it worked as an almost perfect replacement (and was twice as fast ^_^). But, I still would have prototyped the code in floating point first and then added that #define only after it worked. I have been wondering if I should make it a part of DevKit Advance, but it seems just outside of DevKit Advance's scope.
_________________
http://devkitadv.sourceforge.net
#6356 - Maddox - Fri May 23, 2003 7:50 pm
Don't use floating point -- it's just too slow.
_________________
You probably suck. I hope you're is not a game programmer.
#6361 - MojoJojo - Fri May 23, 2003 8:05 pm
Maddox - it should be "you're", not "your".
Jason - yes, I agree, floating point is bashed a bit too much. It's slow, and takes up more code space, but a lot of the time you don't care.
Of course, you don't want it in you're inner drawing loops. But you really don't want much in you're inner loops at all.
#6363 - Maddox - Fri May 23, 2003 8:14 pm
Thanks! I changed it.
_________________
You probably suck. I hope you're is not a game programmer.
#6366 - Jason Wilkins - Fri May 23, 2003 8:35 pm
Are you being sarcastic? Just too slow for -what- Maddox?
You absolutely have to qualify any statement about something being "too slow" or "fast enough". That is my whole point.
I have used floating point on a Commodore 64 (8-bit, 1Mhz processor with intrepreted Basic and software floating point!), I never thought it was too slow for what I was doing.
Actually, I do not think it takes up that much space in ROM either. The most complicated code I remember looking at was a double precision division with remainer and it looked to be about 100 instructions, or half a kilobyte. I'll have to check that again to be sure however.
_________________
http://devkitadv.sourceforge.net
#6367 - Maddox - Fri May 23, 2003 8:42 pm
I don't have to qualify shit.
_________________
You probably suck. I hope you're is not a game programmer.
#6369 - niltsair - Fri May 23, 2003 8:59 pm
Perhaps not, but you sure have to check the spelling. It's still wrong.
It's --you're-- not --you-- neither.
And Jason got a point, what's the point of buying a porshe to drive 1 street away, a bicycle would be as good and less hassle.
From reading pervious post, i thought floating point couldn't be use at all. But now i see then can. So, if i only wanted to quickly check something related to a floating number, i would use it untill my test are done. Or many other circonstances where the hassle of implementing fixed point isn't worth the effort for the speed increase.
Last edited by niltsair on Fri May 23, 2003 9:09 pm; edited 1 time in total
#6370 - Maddox - Fri May 23, 2003 9:06 pm
Ok, you got me, I changed it.
_________________
You probably suck. I hope you're is not a game programmer.
#6372 - Touchstone - Fri May 23, 2003 9:17 pm
Maddox wrote: |
I don't have to qualify shit. |
Why would you want to qualify shit?
_________________
You can't beat our meat
#6374 - niltsair - Fri May 23, 2003 9:28 pm
Errrr
--You're-- stand for --you are--
are= Be verb, 2d person.
is= Be verb, 3rd person.
thus you should remove the --Is-- since the verb is already there.
You probably suck. I hope you're not a game programmer.
#6380 - tepples - Fri May 23, 2003 9:54 pm
Grammar (f)lames in a coding forum?
Who wants to start a port of Zero Wing to the GBA?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#6382 - sgeos - Fri May 23, 2003 10:13 pm
tepples wrote: |
Grammar (f)lames in a coding forum?
Who wants to start a port of Zero Wing to the GBA? |
If is you say yes I do. =P
-Brendan
#6394 - jd - Sat May 24, 2003 3:55 am
Whilst I agree that using floating point is sometimes ok for non-critical code it is a lot slower than fixed point. For example, I had some calculations being performed during setup that took several minutes with floating point but were virtually instantaneous with fixed point, so if the application is at all performance-sensitive then I'd strongly advise against floating point. Although I haven't formally tested it, I'd guess that fixed point is at least 100 times faster.
#6397 - Dracula-X - Sat May 24, 2003 8:13 am
niltsair wrote: |
Perhaps not, but you sure have to check the spelling. It's still wrong. |
If you're going to critique spelling/grammar errors, you should practice what you preach. :)
Quote: |
From reading pervious post, i thought floating point couldn't be use at all. |
'couldn't be used' you mean?
Quote: |
But now i see then can. |
'now i see they can' you mean?
Quote: |
So, if i only wanted to quickly check something related to a floating number, i would use it untill my test are done. |
'until my tests are done' or 'until my test is done' you mean?
Quote: |
Or many other circonstances where the hassle of implementing fixed point isn't worth the effort for the speed increase. |
'other circumstances' you mean?
Ok, you see how utterly pointless it was other than to try annoyingly try and express some intellectual superiority where a) it fails because your subject couldn't give a shit and b) noone else cares because it's a waste of a post and everyone's time? Seriously, it's dumb and futile. 1) This forum has no rules pertaining to proper grammar and spelling. 2) Your average programmer is deficient in these areas, except myself when I feel like it (like now) 'coz I fecking rule' h4w :)
Let's not make this a complete waste of a post. In regards to Jason's principal post/concerns I think it's a good idea to encourage fledgling coders and alike to work with fixed point especially where your target is a limited machine like the gba and the typical gba project is a game. Your average gba scener working on this platform is an aspiring game coder and as such he/she is NOT going to get far relying on floating point assuming their game depends on these calculations. They NEED to get a grip on fixed point, and should be encouraged to do so. Barring some scientific project or some other demonstrations of some r0x0ring maths there really is no point to using floating point on the gba - the lesser accuracy of fixed point will likely not be perceptible on the shitty/blurry gba screen. Seriously.
Regards,
-DX
#6398 - niltsair - Sat May 24, 2003 9:30 am
1. I didn't spent my day flaming some other people post.
2. I was really only trying to correct his spelling in his signature, seeing how it's always displayed.
3. For your info, English is only a second language for me, and most of my spellings are due to typos because I?m working and only want to quickly give a solution I think is adequate.
4. The whole point of Float was that while you should only use them sparsely because of performance issues, in some case you could still have use of them for ease of use for test an where their speed doesn?t really matter (versus the implementation of fixed point).
Thank you.
#6404 - funkeejeffou - Sat May 24, 2003 12:00 pm
Jason,
I totally agree with you with most of your ideas :
- floatting point is great, when a mathematic coprocessor is present.
Michael Abrash said that today, coding on PC with floatting point numbers is faster then coding with integers, and I'm not gonna browse all the pentium 4 docs to see if he's right; he must be right.
-Also, sure that one or two calculation per frame with floatting point numbers won't speed down your code, and accuracy will be better.
- I've coded a 3D engine with floatting points numbers on GBA, and when the code was running fine, I've passed it to fixed point. As you've said, make sure the algorithmic work befor optimising.
And thanks god I did this because it took me two nights to figure out the most accurate format of the fixed point number so that i won't loose too much precision and that I still can store large numbers.
- Off Topic :Maddox, you really are being rude on the forum these times, go get yourself some Prozac or sh** your god damned f***** mouth.
Wanted it to thank you Jason for keeping DevKit alive and improving it, this forum would surely not exists without your compiler, as well as all these cute roms made by modest coders like us ;)
Thank You
#6406 - Daedro - Sat May 24, 2003 5:38 pm
niltsair wrote: |
2. I was really only trying to correct his spelling in his signature, seeing how it's always displayed. |
Never noticed that yesterday. Seriously Dracula X this started out as just spelling advice to someone's signature that will be everywhere the user posts. I had thought it went further than just a spelling correction, but it didn't until you posted. I wouldn't see the point of your post about the grammar/spelling now, all I see is someone trying to be arrogant because they can speak better at the English language. You are lucky to have such a good community of people who do use their literacy on the board, save Link. I guess then again if you really wanted to have tried to impress people with your knowledge you would have corrected all the non capitalized i's in this thread. I don't think there is any reason to be correcting peoples English in a forum unless its a signature. Correcting a signature is like telling someone their fly is down, they have something on their nose, they have toilet paper on their heel, any little thing it is just a nice thing to tell someone about. Although I would think these matters be sent in a private message and not brought out in a topic that doesn't have anything to do with it. In a bigger community an admin would have deleted all those off topic posts about a signature. I hope Dracula that you do not go around doing these types of things a lot when your so new to the community.
I know this will probably bring me to Links level in annoyance, but does anyone have a link to any guilds, tutorials, or sources using floating points? I don't know what they are or how to code them, but I get a basic idea of it from this post.
#6409 - Dracula-X - Sat May 24, 2003 7:02 pm
Quote: |
I had thought it went further than just a spelling correction, but it didn't until you posted. I wouldn't see the point of your post about the grammar/spelling now, all I see is someone trying to be arrogant because they can speak better at the English language. You are lucky to have such a good community of people who do use their literacy on the board, save Link. I guess then again if you really wanted to have tried to impress people with your knowledge you would have corrected all the non capitalized i's in this thread. I don't think there is any reason to be |
Not that I really feel a need to defend myself, but let me just say that someone without a strong command of english literacy should not be dispensing english literacy advice, particularly when said person admits it.
Now, what I wrote was more tongue in cheek than anything else, and of course you are using my argument against me now to illustrate my point which I'm quite certain I made clear (to demonstrate how annoying it is). Correcting people's spelling on a forum is retarded especially when you correct someone and they make it abundantly clear that they don't give a shit (read: maddox), but in and of itself it's annoying. His sig is his and his own, and it couldn't hurt to ASSUME that the grammar error was there intentionally, spoken by someone who hasn't the strongest grasp of english and is simply there there for humor at the expense of the writer.
Now, I have nothing against Niltsair or his english. If you knew me you'd know how many friends I have across the globe, their english is far better then my command of their native language and I coudn't care less to correct them voluntarily unless asked for.
Oh yeah, floating point is still ass slow. :)
-DX
#6410 - niltsair - Sat May 24, 2003 7:29 pm
My grasp of english is fine thank you. As previously mentionned, they were all typos and re-reading it, I could have as easily spotted the mistakes as you did.
I agree that I should have told Maddox about the mistakes in a private msg, I only forgot their existence.
Well, this will be my last post on the subject, since i'm certain most people are thoroughly tired of the subject, and I apologize for the inconvenience.
And yeah, thank you Jason for DevKit :-)
#6412 - Daedro - Sat May 24, 2003 10:24 pm
There is a huge amount of attitude surrounding your posts. I was not dispensing English literacy advice if your understood my comments correctly. What would my weak command of English literacy have to do with dispensing the comment "I don't think there is any reason to be correcting peoples English in a forum unless its a signature." or "I hope Dracula that you do not go around doing these types of things a lot when your so new to the community." since neither were advice, but as close as I can figure you understanding them as. I am mostly stating what you prove every post, that you have too much of an ego that you use in most of your posts so far. I was not using your argument against yourself, you seemed to be trying to show people how well you know the English language. I did read the posts, maddox's comment "I don't have to qualify shit." was replying to a post saying he must "qualify any statement." He thanks the person that first mentioned his spelling error. He also thanked the second person who corrected the spelling error. Where is this obvious post maddox made that states he doesn't give a shit? Maybe you could assume that the grammar error was there intentionally, but maybe the person correcting the sentence knows or assumes the person has English as a second language or not completely educated. Even if we were assuming, it would only be for the first remark about the error because he replied thanking the person and corrected the error, and the first remark was not very off topic than a side comment that could be easily brushed aside, so all assumptions are minor and denied as errors for humor at the expense of the writer. It was a little comment to be confirmed as being intentional, and it was confirmed and then was delved into, but I think a little comment is better than assuming. I tend to forget about the private messenger also, its useful for these little comments.
This is the Jason who created DevKit? Thanks to Jason, keep the versions coming, that compiler has brought many into the community.
#6414 - SmileyDude - Sat May 24, 2003 11:40 pm
Ok, back to the floating point topic :)
I can see where just using the float library would be useful in prototyping, but unless the game is dirt simple or is just a POC (proof of concept -- not piece of crap :D), it will eventually need to move to fixed point. And, in that case, I don't see how any optimisations to the floating point library are going to help (i.e, placing the library in IWRAM, writing it in ARM code, etc).
Jason, I wouldn't spend too much time on the floating point library, unless you just really have an itch to scratch with it :D I know that personally, it's something that I haven't ever used -- heck, I don't even like to do divides on the GBA unless I really need to. But that's just me :)
Also, no matter how fast you get the floating point library, it will still be magnitudes slower than fixed point. There's just no way around that.
_________________
dennis
#6416 - Maddox - Sun May 25, 2003 2:32 am
Do you kids who keep posting that floating point is too slow on the GBA know why it is too slow? (HINT: Go program some floating point routines.)
!XODDAM-
_________________
You probably suck. I hope you're is not a game programmer.
#6418 - Daedro - Sun May 25, 2003 2:36 am
I am a kid not posting it's too slow, I will go program some floating point routines. Any suggestions on tutorials or good reads on the subject?
#6419 - Dracula-X - Sun May 25, 2003 2:39 am
Daedro wrote: |
There is a huge amount of attitude surrounding your posts. I was not dispensing English literacy advice if your understood my comments correctly. What would my weak command of English literacy have to do with dispensing the comment |
Back to literacy for a moment. I was talking about niltsair, not you, in regards to your comment about a good community and literacy blah blah blah.
Quote: |
"I don't think there is any reason to be correcting peoples English in a forum unless its a signature." or "I hope Dracula that you do not go around doing these types of things a lot when your so new to the community." since neither were advice, but as close as I can figure you understanding them as. I am mostly stating what you prove every post, that you have too much of an ego that you use in most of your posts so
far. I was not using your argument against yourself, you seemed to be
trying to show people how well you know the English language. |
No, you just interpret it that way, and if you bothered to read you would see I was merely illustrating how retarded it is to correct spelling - it's a waste of time - it's pointless, much like your argument here, because I'm against those correcting grammar and spelling on a forum where a good deal of ppl don't speak/write english as a primary language. Thank you for making me reiterate the obvious and making my argument for me. Oh, and I don't have a big ego, just a big penis, and thus I tend to speak confidently - that is all.
Quote: |
I did read the posts, maddox's comment "I don't have to qualify shit." was replying to a post saying he must "qualify any statement." He thanks the person that first mentioned his spelling error. He also thanked the second person who corrected the spelling error. Where is this obvious post maddox made that states he doesn't give a shit? |
If you have read maddox's prior posts in other topics you quickly understand his character and where he stands on things.
Quote: |
Maybe you could assume that the grammar error was there intentionally, but maybe the person correcting the sentence knows or assumes the person has English as a second language or not completely educated. Even |
You're reaching on this. Seriously.
Quote: |
if we were assuming, it would only be for the first remark about the error because he replied thanking the person and corrected the error, and the first remark was not very off topic than a side comment that could be |
You know, on my planet - we call that sarcasm. He thanked and stated he changed it - twice. Guess what? The sig is still the same, or in other words - he doesn't give a shit. Seriously.
In the interest of sticking to the topic, kindly do not continue the spelling/grammar convo, it's enough.
#6423 - Jason Wilkins - Sun May 25, 2003 5:23 am
My thread got hijacked by a goofy grammar discussion. Frankly, spelling is not as big a deal as the attitude problem. "I don't have to qualify shit!" is a clear indication that I should not even bother continuing the discussion. ANYWAY!
My position is only that one must us the best tool for the job and that ruling out almost anything as never being the right tool for anything is removing a tool from your programmers toolchest is not a good thing.
For instance, I argued in a previous thread that bubble/insertion sort has properties that might make it the right solution in some cases.
Of course, beginners need to learn how to use fixed point eventually, because they will surely need it, but they also need to learn to "optimize last". Only calculations that need to be done tens or hundreds of times per second need to be fixed point right away.
If there is one point I am trying to make, it is that statements like 'Do not ever use floating point', are incomplete. It should be things like 'Do not use floating point to loop over more than a few items if you have to do it often, like once per frame and especially once per scanline,' and 'Do not use floating point unless precision is critical and speed is not.'
The general form is 'Do not use floating point, in this case, because ...'
How many of us are saying 'Do not use C, it is too slow' just because it can be slower than assembly? I think that software floating point is a very similar thing. We use C to prototype some things, even when we know it will end up needing to be written in asm. We go ahead and write some things in assembly because we know from experience that the C compiler will not do a good enough job (example, the inner loop of a 3D renderer).
I wouldn't say that you should always use floating point first because it might be fast enough. There are lots of cases where you know from the very beginning that it will not be fast enough.
I think that people should be told that software floating point is much slower, not that it should not be used at all. If people know it is 10 to 100 times slower then they will make up their own minds as to whether it is appropriate to use.
_________________
http://devkitadv.sourceforge.net
#6540 - MojoJojo - Wed May 28, 2003 4:42 pm
Quote: |
I argued in a previous thread that bubble/insertion sort has properties that might make it the right solution in some cases. |
Heheheh ... my Data Structures and Algorithm lecturer had a lot of complaints from other lecturers for teaching Bubble Sort, since they were afraid students would start using it. I was going to make the point the Bubble sort and Insertion sort are completetly different, but then I reread and you don't say they are.
Back to the point, I would like to point out that even if you have a well written Fixed point library to work with, its still not as quick an easy to use as floating point. You have to choose your basic number format, whether your can use the same one all the same through etc... Also some functions aren't going to be fixed point friendly, and may well need some fiddling to get working well.
BTW. Are there any good guides around for fixed point numbers around? I thought I knew what I was doing, but I keep on being one out when I go "through" 0. i.e. -5.5+8 comes out at 3.5. My maths seems to working in one's compliment while my display is working in two's compliment :)
#6544 - Maddox - Wed May 28, 2003 6:38 pm
MojoJojo: WTF! You try to give some nugget of wisdom about fixed-point numbers and then you ask if are there any good guides for fixed-point?! Shut the hell up if you don't know what your talking about.
That's the single dumbest post by anyone who's not Link.
-Uncle Maddox
_________________
You probably suck. I hope you're is not a game programmer.
#6551 - Jason Wilkins - Wed May 28, 2003 8:23 pm
Insertion sort is just an obvious optimization of the bubble sort. It is not completely different.
The irony of Maddox's post is so intense that it hurts.
I give up.
_________________
http://devkitadv.sourceforge.net
#6579 - Maddox - Thu May 29, 2003 6:21 pm
Wilky,
If you are saying I don't know what I'm talking about, you is wrong.
_________________
You probably suck. I hope you're is not a game programmer.
#6603 - excessus - Fri May 30, 2003 9:55 am
My thoughts on this issue... Floating points are bit dangerous to use in code that needs to be run in interrupt loop unless you know how to profile and benchmark your code. Lots of troubles come in form of graphics glitches when you don't have time to update screen while your floating points are being calculated. But there are instances where you can use floating points with gba, like pre calculating stuff with precision (sin,cos tables for example). Also if you have processing time left of course you can use it to get precision and use floats, but this comes to the profiling to see how much you actually have time to do the math. So if your code works fine with floats I see no reason why you couldn't use them. If you want to stay out of troubles use fixed point :)
_________________
Current binary for my pinball game demo:
www.lut.fi/~rusakko/gba/flibu.gba
#6605 - Paul Shirley - Fri May 30, 2003 10:55 am
removed
Last edited by Paul Shirley on Sun Mar 28, 2004 10:02 pm; edited 1 time in total
#6607 - Daikath - Fri May 30, 2003 11:10 am
maybe a tad offtopic, but I thought this was a nice optimization tutorial.
http://bdn.borland.com/article/0,1410,28278,00.html
_________________
?There are no stupid questions but there are a LOT of inquisitive idiots.?
#6626 - niltsair - Sat May 31, 2003 5:50 am
Eh thanks for the tutorial's link.
While i knew most of it. It helped me along to optimize some display code.
Didn't knew that i should separate logn equation on multiple lines, so the compiler wouldn't use temp variables. Also never thought about declaring variable as 'registers' for better optimisation while compiling.
#6654 - tepples - Sun Jun 01, 2003 2:37 am
Remember that some optimization techniques that make x86 code faster won't have much effect on ARM or Thumb architectures or vice versa for various reasons, including the fact that ARM has more general-purpose registers than x86 (15 vs. 8), the three-operand instruction format (a = b op c vs. a = a op b), and the fact that constants have to be loaded in pieces.
Always profile the "before" and "after" versions, and look at the generated code (add -S in your compilation command line).
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#6687 - Jason Wilkins - Sun Jun 01, 2003 11:07 pm
There are fsin, fcos, and so-on which are float versions of sin, cos, etc. So, math.h is not totally ruled out.
register is an almost obsolete keyword! No modern compiler, even when you tell it not to optimize, will put automatic variables (local variables) into memory, unless it is like the 386 which does not have many registers. And even then, the compiler is probably in a better position to know which variable is best to put into a register.
You would need to have more than 8 or so registers live at the same time before the ARM runs out and has to save anything to the stack.
As for temporary values, why are people so afraid of letting the compiler produce them? Under what conditions does a compiler produce temporary values which would not you would name make explicit if you break the expression down yourself.
It may be useful to get rid of what are called 'common sub expressions', even though the compiler is capable of noticing redundant code, it makes things easier to read if you do it yourself.
The whole point of the original post is that people optimize too early. The only hard and fast rule of optimization is 'Don't do it!'
This has two meanings to me. The first is that the fastest optimization is to not do something at all, doing nothing takes zero time ^_^
The second meaning is that you should not optimize, at least, not until you know you have to.
_________________
http://devkitadv.sourceforge.net
#6691 - niltsair - Mon Jun 02, 2003 12:03 am
Following some advices in the optimisation document, i had a ~2x speed increase. Due to the use of 'register' keyword, use of pointer instead of indexed array and temp variables being removed by writng code in many steps instead of a single expression. And I sorely needed this speed increase :)
I totally agree, First step : Clarity, Second step: Optimisation(when needed).
#6750 - Jason Wilkins - Mon Jun 02, 2003 3:30 pm
Actually, after looking at the linked page, I see that those "optimizations" are so basic that I do not think of them as optimizations anymore ^_^
If you were not following that document I would have looked at your code and thought that you didn't know how to program, not that you didn't know how to optimize.
I still think that 'register' is a rather useless keyword. You may have gotten a 2X speed up altogether, but I bet that 'register' contributed absolutely nothing unless you are on a 386 or have really complicated code. I would have to see the C code and asseembly output myself in order for me to believe that.
I would never rely on the register keyword, it is just so unpredictable, that a small change to your code, and you really need to remove the keyword and test it all over again because you never know if the compiler is actually paying attention to you, or if the new code will actually be worse because of the keyword. Changing the version of the compiler you use could screw it up too.
I bet that if I dig into gcc I will find that the register keyword is ignored by the ARM backend.
Some of the other optimizations are good to do only if you want the code to be fast when you compile it without optimzation on. For example, the pointer deferencing in a loop example is braindead simple for gcc to optimize. But, it is a good example of how to make code easier to read AND faster.
The whole thing about a + a1 + a2 + a3 creating temporary objects while a += a1; a += a2; a += a3; will not is misleading I think. Probably because the author of this document is coming from a C++ angle. Any decent compiler produces very similar code for both if the variables are all of the same basic type (e.g., integers). Optimizers would have to be pretty incompetent to mess that up.
This IS important when using C++, because it is likely that the implementation of your += operator will not need to create a temporary object, but the + operator will. That is one reason why you have to be very careful with operator overloading, because it hides function calls (which is also the very reason why operator overloading is so useful!. A double edged sword).
Actually, a lot of the recommendations are very good for C++ because its operator overloading and other factors can break the ability for the compiler to optimize. For instance, overload any of the operators involved in an expression and suddenly the compiler cannot optimize it anywhere near as well and you have to do it yourself.
I would probably recommend that web page to anyone not familiar with these things already, since none of the recommendations lead to less readable code, and most of them actually make things more readable. I woldn't call it 'how to optimize' however, more like 'common sense coding'
My book on writing good (readable) code has many of these same recommendations.
_________________
http://devkitadv.sourceforge.net