r4 - 29 Aug 2006 - 17:59:26 - TravisVachonYou are here: OSAF >  Projects Web  >  ContributorNotes > TravisVachonNotes > ChandlerPysizer
Information on Pysizer can be found here:

http://pysizer.8325.org/

Pysizer can run with either an unpatched or patched interpreter. The patched interpreter is much more powerful, but will require you to build all of the chandler binaries. Fortunately, this shouldn't be too tough, but it will take a while.

Download

A branch of Chandler which will automatically install Pysizer can be checked out from SVN here:

http://svn.osafoundation.org/sandbox/travis/chandler-branches/pysizer-branch

Install

NOTE: Recent WX changes have introduced a seg fault when importing wx with the patched interpreter. To fix, change SVN_REVISION in external/wx/Makefile to 88

Pysizer with an unpatched Python interpreter can be installed with make install in the pysizer-branch/chandler directory.


Pysizer with a patched Python interpreter can be installed with

export BUILD_ROOT=`pwd`; make compilers; make env; make world
in the pysizer-branch/external directory

These instructions have been tested on Linux. Please edit this page with additional instructions for other platforms.

Explore

You should definitely run Chandler with the --nocatch option. Weird things will happen otherwise...


Currently, Chandler.py has been hacked to enter Pysizer's interactive mode just before it drops into the wx MainLoop. An excellent project would be to add a menu item that enters Pysizer mode, so this could be done at any time.


One particularly interesting thing to do with Pysizer which requires a patched interpreter is the following set of commands:

from sizer annotate, formatting
creators = annotate.findcreators(objs)

WARNING: This will eat quite a bit of RAM, and is likely to take several hours.

I have left it going for 8 hours, and it did not stop. By the end, it had a virtual memory footprint of ~1.5GB and a resident memory footprint of ~900MB.

I recommend a machine with at least 2GB of RAM and no other major tasks.

UPDATE: This is considerably faster for smaller subsets of the object dictionary. See ChandlerPysizerExploration20060825 for an example.


Once completed, this will allow us to see which lines of code create the most objects with this code:

formatting.printsizes(creators.back, count=9)


More information on using Pysizer can be found here:

http://pysizer.8325.org/doc/tutorial.html

-- TravisVachon - 25 Aug 2006

Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r4 < r3 < r2 < r1 | More topic actions
 
Open Source Applications Foundation
Except where otherwise noted, this site and its content are licensed by OSAF under an Creative Commons License, Attribution Only 3.0.
See list of page contributors for attributions.