From 6c0923428963e3a9135015b32f736e38849f1ae0 Mon Sep 17 00:00:00 2001 From: Steve Slaven Date: Thu, 6 Aug 2009 22:52:18 -0700 Subject: Don't gzip serialized data anymore since it's basically just a single key in the physical file, and the chunked data that has the actual file chunk contents is already compressed. Compressing the single key data in the tree actually makes it bigger (50+ bytes instead of 34) which can be seen by gzipping them manually to test diff --git a/FuseArchive/Serializer.py b/FuseArchive/Serializer.py index 621d90a..eb14cec 100644 --- a/FuseArchive/Serializer.py +++ b/FuseArchive/Serializer.py @@ -15,10 +15,10 @@ class Serializer: logging.debug( "Going to serialize %s to %s" % ( obj, fh ) ) fh.truncate( 0 ) fh.seek( 0 ) - f = gzip.GzipFile( None, "wb", gzip_compress_level, fh ) - #f = fh + #f = gzip.GzipFile( None, "wb", gzip_compress_level, fh ) + f = fh f.write( Serializer.dumps( obj ) ) - del f + #del f fh.flush() @staticmethod @@ -39,8 +39,8 @@ class Serializer: def loadfh( fh ): logging.debug( "Going to load from %s" % fh ) fh.seek( 0 ) - f = gzip.GzipFile( None, "rb", gzip_compress_level, fh ) - #f = fh + #f = gzip.GzipFile( None, "rb", gzip_compress_level, fh ) + f = fh magic = Serializer.loads( f.read() ) return( magic ) -- cgit v0.10.2