elixiroflife4u/cs174a_term_project — pull request #11 by mikesech (2011-11-17 06:15:54+00:00)
Title: Memoized the result of WorldEntity::getTranslate() for each frame. 

Added a global frame counter (incremented for each call to animate())
to enable said memoization -- the memoized value is only used during
the frame it was calculated.

While my CPU utilization still remains near 100% of one core, the time
spent in animate() dropped from 72.40% to 24.67%. Time spent in
getTranslate() dropped from 70.04% to 18.67%. Note, however, that both
profiles were conducted with 100 bullets in the world. I still think that we
should include this optimization, though, since it trades limited CPU time
for less expensive memory.

There is room for further optimization by only doing the recalcuation if
any ancestor's transformations have changed.