I need some help with linux profiling...

Clay

10-12-2005 04:58:51

The SWIG for Python maintainer has sent out an email to maintainers of large Python/SWIG projects. He has made major changes to SWIG cvs and wanted us to test them.

The good news is, he has made major improvements to the generated code, which have some speed improvments to many aspects of SWIG. The bad news is, PyOgre runs much slower on the new version of swig. Upwards of a 40% decrease in speed.

I have been talking to him in e-mails trying to figure out what the problem could be, but in the end we really need to profile the code to find the problem. I do not have linux set up (nor a hard drive to install it on right now).

So, I need someone's help. Basically we need to build a copy of PyOgre under linux with Swig 1.3.27 and with SWIG from CVS and do the following:
  1. Check to see if the slowdown still occurs.[/*:m]
  2. Profile PyOgre using gprof or valgrind and find the difference between the two libraries.[/*:m][/list:u]

    This may require building Ogre with -pg and obviously building PyOgre with -pg. Does anyone have experiance in profiling that can help out here?

    This could also be done under windows if someone has a profiler. I'd be happy to wrap up two seperate versions of pyogre for someone to use. I just don't have the money to buy a profiler for windows myself.

    In the mean time I'll try to build this under cygwin and use gprof, but I'm not sure how successfull I will be.

    Thanks.

dermont

12-12-2005 13:54:17

Pyogre using swig versions 1.3.25 and 1.3.27 both run fine.

Swig CVS version 1.3.28:

$ swig -version
SWIG Version 1.3.28

$ python TransparencyDemo.py (and all other demos)
File "TransparencyDemo.py", line 2, in ?
import pyogre.ogre as ogre
File "/usr/lib/python2.3/site-packages/pyogre/ogre.py", line 272, in ?
OgreException = ExceptionPtr
NameError: name 'ExceptionPtr' is not defined

Downloaded using:
cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/swig login
cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/swig co -P SWIG
OR cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/swig co -P -rHEAD SWIG

Confused, thought the ExceptionPtr problem was due to older version of swig.

Clay

12-12-2005 14:51:24

Sorry I should have updated this thread.

We fixed the problem on saturday: the current changelog has the details.

When building with the new SWIG there are no more "Ptr" classes, so that line will become OgreException = Exception.

dermont

12-12-2005 17:44:17

Glad you got it sorted. Sorry I should have read the changlelog. After updating the Ogre/CEGUI Exception and wrapping the widget's event name in str eg:
self.ec=quitButton.subscribeEvent(str(quitButton.EventClicked),onQuit).

everything works fine. Anyway this is probably better left for another day.

Clay

12-12-2005 20:02:15

hmmm that's odd. I may need to report that as a regression. I ran into a similar problem with it, but I didn't keep the example around.

Is the quitButton.EventClicked a python string? If not that should probably be fixed.

dermont

14-12-2005 18:36:01

Sorry, haven't really had the time to look into this,however using swig 1.3.27/28
..
print type(quitButton.EventClicked) shows
..

swig 1.3.27 Type is <'str'>
swig 1.3.28 Type is <class 'pyogre.cegui.String'>