volca02 / openDarkEngine

Rewrite of the Dark Engine by Looking Glass
GNU General Public License v2.0
147 stars 18 forks source link

Frame timing spikes #17

Open volca02 opened 10 years ago

volca02 commented 10 years ago

I need a better tool to track down the frame timing issues (to be easily seen in t1/miss2.mis starting position for example). Something tells me it is some kind of a lazy initialization, probably avalanches of object placement/lighting calculations etc. A tool that shows that exactly is needed.

volca02 commented 10 years ago

I think we can introduce a tracer macro spawning a RAII object that will inform some object about the current running/terminating tasks. Then we can stick it throughout the code and build a tool to review the results.

The macro would be opt-in via a cmake flag (otherwise compiling to nothing).

The RAII would call start(func) in ctor, stop(func) in dtor. The resulting data would get written in a vector (microsecond time, function name) and could be analyzed.

volca02 commented 9 years ago

A few remarks:

volca02 commented 6 years ago

Frame spikes are caused by lights. What happens is that light list population gets too pessimistic, light lists get enormous. And current ogre3d does not help at all, thanks notably to these two commits: b02a054fff, cf09575fb2 which devirtualize key methods that could be used to handle the light population better. It could probably be solvable with movable listener but it seems more and more like stapling tentacles to a horse to make it look like an octopus.

What will follow is departure from ogre3d, it does not serve the needs of the project too well.