Original Post
I''ve recently been profiling my application (a particle engine), with both the Intel Vtune program and AMD CodeAnalyst. I''ve noticed two hits in this program that are extremely expensive, but for what reasons I have no idea. The top most expensive run time line is in the update function of the particle engine. The line is a simple
m_Life += Elapsed_Time; //update the lifetime of this particle
But it in fact takes up a HUGE amount of processor time relatively speaking. Compared to the rest of the lines in this function, some of which have 2, maybe 3 multiplications and additions, this one is nothing.
The other line makes even less since. It''s the shortest function in the program, a simple access to private operator function, a boolean. yet it is the second most expensive function in the entire module.
bool IsInitialized() {return m_Initialized};
No idea why this one is so expensive either. To make sure it wasn''t a fluke, I built the release version with debug info and profiled it too, same results.
I think if I were to eliminate these bottlenecks, I''d probably be able to gain 30 or 40 fps, possibly more.
Any help here. Ask me if you want the dissasmbly info. Athlon XP 2000+