Tuesday, February 26, 2008

PySoy goes from 3 threads to 5

We're doing the final work now to replace CoreLoop with TransportLoop, WindowLoop, and SceneLoop. All three are instances of soy._internals.LoopThread which (should) play well with Python's threading system and should never hold the GIL.

The increased performance this has brought for multi-core users is amazing, some have reported more than twice the framerate!

To be fair, an equal number of subversion Trunk users are experiencing frequent segfaults since we've not finished adding mutexes and rearranging the internal API post-move. Obviously these issues are being resolved prior to the Beta-3 release next month.


Game_Ender said...

Do you cache the physics object's locations/orientations somewhere that can be accessed without blocking the Scene thread? It seems to me that things like the AI will need to make calls to the physics engine to determine when bodies are touching, who's in range of who, and who can see who.

Arc Riley said...

Yea that's one of the changes. Tickets such as #934 involve removing ODE calls outside the SceneLoop thread to drawing from values.

With lights, for example, illumination geoms translate to a bit pattern on each body caching which bodies are lit by which lights, so rendering can simply use this data directly to determine which bodies to render during each illumination group.

Further optimization will include pairing down the frequency of these things; illumination and visibility tests need not be as frequent as collisions which guide movement. This is all down the road..