[TurboGears] Re: Gzip compression of .py and .kid files.

2007-02-28 Thread Marco Mariani

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.
   
You can import python from .zip files (since python 2.3), and distribute
precompiled kit templates, but what kind of file system are you using
anyway?

If it's not targeted to flash disks (i.e. balance the usage of the disk,
etc.), a filesystem like ext3 could dig holes in it :-)



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
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
-~--~~~~--~~--~--~---



[TurboGears] Re: Gzip compression of .py and .kid files.

2007-02-28 Thread Chris Dew



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.

Thanks for your reply,

Chris.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
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
-~--~~~~--~~--~--~---



[TurboGears] Re: Gzip compression of .py and .kid files.

2007-02-28 Thread Tim Lesher

On 2/28/07, Marco Mariani [EMAIL PROTECTED] wrote:
 If it's not targeted to flash disks (i.e. balance the usage of the disk,
 etc.), a filesystem like ext3 could dig holes in it :-)

Not true--flash _disks_ present a block access layer, and
write-levelling is done at block-translation time (otherwise, digital
cameras, USB keychain drives, and MP3 players, all of which usually
use FAT, would be falling over left and right).

You only need to worry about write levelling if your driver is
directly writing to honest-to-goodness, block-at-a-time flash chips,
without any virtualization.

Easy test--if you can write less than a block at a time (usually 128k)
to flash, then you're using a virtualization layer, which should be
capable of wear-levelling. :-)

One thing you might want to do in either case is changing
configuration parameters to reduce the number of writes you do
overall, though (for example, turning off last-access-time recording,
which Windows CE does automatically and which you can do under Linux
via mount arguments).

-- 
Tim Lesher [EMAIL PROTECTED]

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
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
-~--~~~~--~~--~--~---



[TurboGears] Re: Gzip compression of .py and .kid files.

2007-02-27 Thread Joshua J. Kugler

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.

j

-- 
Joshua Kugler   
Lead System Admin -- Senior Programmer
http://www.eeinternet.com
PGP Key: http://pgp.mit.edu/  ID 0xDB26D7CE
PO Box 80086 -- Fairbanks, AK 99708 -- Ph: 907-456-5581 Fax: 907-456-3111

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
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
-~--~~~~--~~--~--~---



[TurboGears] Re: Gzip compression of .py and .kid files.

2007-02-27 Thread Bob Ippolito

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

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
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
-~--~~~~--~~--~--~---



[TurboGears] Re: Gzip compression of .py and .kid files.

2007-02-27 Thread Chris Dew

Thanks, I'll give it a try.

Regards,

Chris.

On Feb 27, 11:35 pm, 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.

 j

 --
 Joshua Kugler
 Lead System Admin -- Senior Programmerhttp://www.eeinternet.com
 PGP Key:http://pgp.mit.edu/ ID 0xDB26D7CE
 PO Box 80086 -- Fairbanks, AK 99708 -- Ph: 907-456-5581 Fax: 907-456-3111


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
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
-~--~~~~--~~--~--~---



[TurboGears] Re: Gzip compression of .py and .kid files.

2007-02-27 Thread Bob Ippolito

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 turbogears@googlegroups.com
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
-~--~~~~--~~--~--~---