pioneerspacesim/pioneer — pull request #2200 by fluffyfreak (2013-04-10 19:49:48+00:00)
Title: Cleanup the new eclipse/shadow code.

Ugh. There's still some things to tidy up. Like the magic number 3, but this significantly reduces the amount of crazy memory allocation that the new eclipse stuff was doing.

It was using std::lists everywhere, not reserving, returning by copy, using temporaries and doing some other nastiness. I noticed it was having a very nasty effect on the amount of CPU time being used and it was coming very high in my profiling.

The current solution is to use a temporary static vector that is cleared and then filled by reference instead of by copy within the camera implementation.

Comments and ideas welcome.

Would be nice to get this in before this alpha launches!