Python comment stripper

Delaney, Timothy tdelaney at avaya.com
Wed Sep 18 21:12:43 EDT 2002


> From: Dennis Reinhardt [mailto:DennisR at dair.com]
>
> At the time extraction is going on, it is impractical for 
> Python to be doing
> the extraction -- there is the Python DLL (v2.0: 653 Kb and 
> v2.2: 821 Kb)
> for starters.  I am aiming for a small footprint.  The 361 Kb 
> download has
> Python22.dll inside and that DLL  is used when the hello 
> program runs. :

Um ... if you are including Python22.dll in the download, surely that is
dwarfing your code size?

Using your numbers ...

>                       raw Kb          compressed Kb
>                     ----------    --------------------
> original              10.44               2.98
> 4 spaces -> 1 space    8.85               2.86
> + strip comments       4.65               1.34

So you would have:

821 -> 365 (I zipped it up ;)

Therefore your package sizes would go from 368 KB -> 366 KB.

Even assuming you have 100 times as much (compressed) code, and the comment
savings are identical:

663 KB -> 499 KB

Is the savings worth the hassle?

Tim Delaney




More information about the Python-list mailing list