Erik Søe Sørensen <[EMAIL PROTECTED]> writes: > Hello, > I have been doing some profiling on Globulation 2, and found some useful > results. > (I began doing this because the Ubuntu release (0.8.21) had periods of > 100% CPU activity, but that seems to have been fixed :-) > > Map::updateLocalGradient() seems to be a bottleneck (~40% of the time > spent there). > In this function, there are at least two opportunities for speed > improvement. > > For 21% improvement (of the function's run time), get rid of the array > introduced in Map.cpp:3889:
Thank you very much!!!! Please continue to do this with new releases!!! This is great!!! By the way, can you please write a short profiling “how to” explaining what exact commands you typed to obtain this information? That would be really helpful (because on different machines and/or with different configuration options different portions of the code might be the worst spots, so it would be nice if other people could easily do the same profiling). -- Joe > (This happens at several other locations, by the way... the second-worst > place in Map.cpp appears to be in Map::updateRessourcesGradient(), and > it'might also be worth the attention :-) > > And another thing, now we're at reading code: > A couple of places in Map::updateLocalGradient(), there is code like this: > if (xxi<0) > xxi=0; > else if (xxi>31) > xxi=31; > if (yyi<0) > yyi=0; > else if (yyi>31) > xxi=31; // <-- Shouldn't this be yyi?? > That last line does look like a typo (or more likely a copy'n'paste error?). > > Regards, > Erik Søe Sørensen > > PS: Great looking game, by the way! :-) > > > [Profiling done on a ThinkPad, CPU: Intel(R) Pentium(R) M processor > 1300MHz stepping 05] > [Today's lesson: Don't begin profiling on a non-optimized build.] _______________________________________________ glob2-devel mailing list glob2-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/glob2-devel