[Twisted-Python] Example code for problem with twisted+pyglet

Nathan nathan.stocks at gmail.com
Tue Apr 1 19:19:42 EDT 2008

(I'm cross-posting this to the twisted and pyglet mailing lists, as
I've been actively discussing this with people on both lists)

Problem:  When I add AMP with SSL with SSL-client certificates to
Pyglet 1.1 (svn trunk, actually) on OS X 10.5.2, pyglet goes from
drawing at a smooth 60fps (which is the limit I set) to an extremely
choppy low fps.  The problem started when I upgraded from Pyglet from
1.0 to 1.1.


MacBook Pro, Intel Core 2 Duo, 2.2Ghz, 2GB RAM, GeForce 8600M GT w/128MB VRAM


OS X 10.5.2 with Graphics Update
Apple-installed python 2.5.
Twisted 8.0.1 (installed package from
-- export PYTHONPATH=/Library/Python/2.5/site-packages )
pyglet trunk (revision 1990, http://pyglet.googlecode.com/svn/trunk -
installed with 'sudo python setup.py install' )

To duplicate:

1) Download http://stocksfam.com/example.tar.bz2 and untar it with
"tar jxvf example.tar.bz2" which creates an example directory.
2) Open two terminals and change to the example directory.
3) Run "./server.py" in one terminal.  This sets up an AMP+SSL server.
4) Run "./client.py" in the other terminal.  The Pyglet+AMP+SSL client
will launch, and a Pyglet 1200x800 window will pop up with a gray log
5) Click and drag the gray log window around.  Notice how extremely
choppy it is.  I don't know how to debug it!  Under Pyglet 1.0, there
was no choppiness -- it stayed a smooth 60.0fps.

What can be done to debug this?  If I knew where to start, I'd try to
find the problem myself, but I'm not very familiar with the internals
of twisted or pyglet, and I'm also not very familiar with debugging
python code beyond using print statements and common sense...

~ Nathan

More information about the Twisted-Python mailing list