[sugar] Removing docstrings

C. Scott Ananian cscott at laptop.org
Tue Aug 26 11:08:39 EDT 2008


On Tue, Aug 26, 2008 at 3:47 AM, riccardo <riccardo.lucchese at gmail.com> wrote:
> On Mon, 2008-08-25 at 19:08 -0400, C. Scott Ananian wrote:
>> A previous message (can't find it now to respond to it, sorry)
>> indicated that static docstrings were responsible for a significant
>> amount of sugar's runtime memory requirements.
>>
>> The python interpreter's "-O -O" option specifically addresses this;
>> it removes docstrings from the running image.  This command-line
> Awesome!, didn't know of the `-O -O' option.

After cursory tests:
 * it appears that the proper python command line is
'#!/usr/bin/python2.5 -OO'; using 'env' or separating the '-O' options
doesn't work.
 * when you do this, /usr/lib/python2.5/site-packages/numpy/ma/core.py
raises an exception, since it does a '+=' on its __doc__, and __doc__
is None.  Commenting out line 3256 fixes this.  I've attempted to
report this bug upstream, but numpy does not appear to have any bug
tracker. =(

Other than that, seems to work.  I could still use some help doing
some measurements to quantify the improvement (if any), since most of
my day today will probably be spent on build-related issues.
 --scott

-- 
 ( http://cscott.net/ )


More information about the Sugar mailing list