On 2/27/07, Chris Dew <[EMAIL PROTECTED]> wrote:
>
>
>
> On Feb 27, 11:43 pm, "Bob Ippolito" <[EMAIL PROTECTED]> wrote:
> > On 2/27/07, Joshua J. Kugler <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> >
> >
> > > On Tuesday 27 February 2007 12:46, Chris Dew wrote:
> > > > I'm new to Python and TurboGears.  I haven't been able to find the
> > > > answer to my question by Googling, possibly because "gzip" is
> > > > everywhere on the web.
> >
> > > > The context of my question is: deploying a TurboGears application onto
> > > > a system with limited (flash) storage.  I am aware of the various
> > > > compressed filesystems available, but I'm considering other
> > > > approaches.
> >
> > > > Is it possible to deploy a TurboGears application with all/some of
> > > > it's source .py and .kid files gzipped to save space?
> >
> > > Python itself can import zipped files (zip, not gzip AFAIK).  I've not 
> > > tried
> > > zipped kid files.  I *think* it just overloads python's import routines, 
> > > so
> > > it might be able to.
> >
> > I'd doubt that the templates would work, but the sources would. It's a
> > non-trivial amount of effort though.
> >
> > You're probably prematurely optimizing though. Is it work that much
> > effort to save (if you're REALLY lucky) about 1MB?
> >
> > -bob
>
> That's a good point about it being premature optimisation.
>
> If the (application *and* framework's) .py and .kid files are only
> 1.5Mb, I would save 1Mb.  I expect there are more than 1.5Mb of
> files.
>
> Even 1Mb is good if you've only got 16Mb.  I should have more than
> that, but you're fighting bloat all the way with flash.
>
> With the work involved, I may be better off storing much of the
> application/framework on some form of compressed (read-only?) loopback
> filesystem.  I was (perhaps naively) hoping that you could set
> USE_GZIP = TRUE in a configuration file.

Well dependent libraries are easy enough if they're egg zip
compatible, you don't have to do anything -- they're already zipped.
You said TurboGears application, not the rest of the stack. Still not
really worth spending much time on though.

A compressed filesystem like squashfs or cramfs is a much easier and
more standard approach to this sort of problem *and* it will compress
things like extensions and executables (which dwarf Python bytecode
most of the time) where any other solution will not. If you truly
constrained to double digit MBs you're going to want (perhaps even
need) to use one anyway for the rest of the OS.

-bob

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to