Thursday, December 2, 2010

Profiling the Engine

Last night I did some research into what's eating up cycles when running a simple test (I used tutorial 11 from the v2.0 branch).  It appears that rendering is where the majority of the time is being spent.  I tested everything from Container to PooledObject, Iterator to SpatialGrid in the hopes of finding something that was really devouring time.  When I finally got to SpriteComponent, RenderContext, and CanvasContext, it came down to drawing paths and drawing sprites.  While most of the profiles were returning < 1ms average for every run, these areas (especially drawing images) were taking the most time.  Most profiles would execute 2000 times with a combined total of 300 or less milliseconds, while the actual drawing of images was doing 1800-2300 ms total for 2000 execution cycles.  While it isn't something I can directly improve upon, there are some things which can be done to mitigate the issue a bit.  But this brings up the question: is it worth spending the time on?

No comments:

Post a Comment