[sugar] Removing docstrings

riccardo riccardo.lucchese at gmail.com
Tue Aug 26 03:47:32 EDT 2008


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
> option is probably appropriate for use for the sugar shell to allow us
> to preserve doc strings for interactive use and offline documentation,
> while removing the memory penalty and any disincentive for developers
> to properly document their APIs.
> 
> Is anyone interested in changing the first line of
> /usr/bin/sugar-shell to '#!/usr/bin/python2.5 -O -O' and measuring the
> execution time / memory size savings attained?  Bonus points if you
> can quantify the NAND space / speed tradeoff involved in using .pyo
> files, which are enabled by the first -O option, since by default we
> are deleting .pyo files to save space.  Are the memory/speed
> improvements obtained with '-O -O' worth the cost?
>  --scott

Awesome!, didn't know of the `-O -O' option.

Last time I checked with guppy/heapy we had 40+% of the shell reserved
to strings. On top of the list were docstrings. I aspect doc strings to
take the most of that 40%, not sure thought.

riccardo



More information about the Sugar mailing list