glob2-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[glob2-devel] Echo Gradient Optmization


From: Bradley Arsenault
Subject: [glob2-devel] Echo Gradient Optmization
Date: Thu, 6 Jul 2006 17:32:19 -0700

I'm having a hard time keeping the cpu usage of my new echo AI system
down. I've been doing most profiles of echo, and too my great
surprise, Echo uses arround 20% of the cpu with full optmizations. In
comparison, Nicowar uses 5% of the cpu, and Castor uses arround 0.6%
(all with optmizations). I figured it could be becaues Echo used 32
bit integers for its gradient (I hadn't yet changed that), so I
decided to profile various integers on my system. Keep in mind that I
reduced the delay in Engine.cpp to make the game run faster, so Echo
uses about half as much the total cpu time:

Signed 32 bit
[13]     9.2%    0.79    0.26     635
AIEcho::Gradients::Gradient::recalculate(Map*) [13]

Unsigned 32 bit
[12]     9.7%    0.74    0.35     635
AIEcho::Gradients::Gradient::recalculate(Map*) [12]

Signed 16 bit
[15]     7.0%    0.54    0.26     635
AIEcho::Gradients::Gradient::recalculate(Map*) [15]

Unsigned 16 bit
[14]     9.1%    0.70    0.31     634
AIEcho::Gradients::Gradient::recalculate(Map*) [14]

Signed 8 bit
[15]     8.2%    0.60    0.31     635
AIEcho::Gradients::Gradient::recalculate(Map*) [15]

Unsigned 8 bit
[15]     8.7%    0.60    0.36     634
AIEcho::Gradients::Gradient::recalculate(Map*) [15]



Interestingly enough, signed always outperforms unsigned. The 16 bit
signed test seemed somewhat of an anomaly, so I redid it, and, to my
surprise again, it turned up at 7.6%. The margins inbetween the
numbers are very small, but do indeed prove that some integers are
better than others, in particular, Signed 16 bit integers are my
personall choice.

Unfortenetly, the integer of choice won't make any noticable
consumption difference, the margins are too small.

Someone else may want to do these tests on thier own machine, I'll
explain how if asked.

-- Bradley Arsenault




reply via email to

[Prev in Thread] Current Thread [Next in Thread]