While at GDC last month, I went to a talk on optimizing C++ given by a person from Microsoft that evaluates the XBox games. The #1 thing was to run a profiler. That was it. He was amazed how many games he reviewed that didn''t use one. He got a MINIMUM 25% increase in frame rate on all games evaulated. Mainly from running the game through a profiler.
As for why Microsoft doesn''t supply one, that''s anyones guess.
- onebeer
Fine tuning C++ code?
Hi!
No offense, but I really wonder if you'd notice any difference in speed in any test you can think of (talking about this ++i instead of i++). Optimizations like this one is not something any serious programmer would do. Note that you usually do something hundreds (if not more) times more expensive inside the "for" branches.
I can't think of any serious code sample where such optimization would be noticeable. Tell me if I'm missing something important.
I would divide optimizations that make sense into 2 kinds:
1. Algorithm related.
Much more important in most of the applications nowadays.
Exceptions here are "only": real-time applications and drivers, otherwise optimizing down to stuff like "make 2 tricky assignments instead of 4" doesn't usually make any sense but makes your application much more difficult to understand for the others and makes it more buggy.
A well designed and clever algorithm will speed up you application much more than poor but dangerous tricks you can do with C/C++.
A well known rule for software developers is KISS which stands for "Keep It Stupid Simple", which - a bit exagerating - expresses best what I'm talking about.
2. Coding tricks.
These are the things that are exceptions from above - mostly computer games, real-time simulators etc.
You should keep in mind however not to optimize everything, but just the critical pieces of your code like (just few examples):
- copying some large arrays of vertices
- interpolating thousands of vertices of your models in real-time
- precomputing some computationally expensive values
[edited by - MickeyMouse on April 7, 2004 4:43:44 PM]
quote:Original post by tolleyc
Summary: Use ++i, not i++
No offense, but I really wonder if you'd notice any difference in speed in any test you can think of (talking about this ++i instead of i++). Optimizations like this one is not something any serious programmer would do. Note that you usually do something hundreds (if not more) times more expensive inside the "for" branches.
I can't think of any serious code sample where such optimization would be noticeable. Tell me if I'm missing something important.
I would divide optimizations that make sense into 2 kinds:
1. Algorithm related.
Much more important in most of the applications nowadays.
Exceptions here are "only": real-time applications and drivers, otherwise optimizing down to stuff like "make 2 tricky assignments instead of 4" doesn't usually make any sense but makes your application much more difficult to understand for the others and makes it more buggy.
A well designed and clever algorithm will speed up you application much more than poor but dangerous tricks you can do with C/C++.
A well known rule for software developers is KISS which stands for "Keep It Stupid Simple", which - a bit exagerating - expresses best what I'm talking about.
2. Coding tricks.
These are the things that are exceptions from above - mostly computer games, real-time simulators etc.
You should keep in mind however not to optimize everything, but just the critical pieces of your code like (just few examples):
- copying some large arrays of vertices
- interpolating thousands of vertices of your models in real-time
- precomputing some computationally expensive values
[edited by - MickeyMouse on April 7, 2004 4:43:44 PM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement