Re: GzipOutputStream is slower than gziping the file by hand

2009-07-17 Thread Peter Keen
Here is the patch. I included parameters for both the compression level and the compression strategy, both of them defaulting to the same thing the gzip binary uses. --Pete On Wed, Jul 15, 2009 at 4:37 PM, Kenton Vardaken...@google.com wrote: OK.  Make sure that the parameter is optional, with

GzipOutputStream is slower than gziping the file by hand

2009-07-15 Thread Peter Keen
Hi guys, I'm playing around with protocol buffers for a project at work and I'm coming across a possibly weird problem. I have the following setup in my main(): std::cerr creating file std::endl; int fd = open(blah.repo, O_WRONLY, O_CREAT); if ( fd == -1 ) { std::cerr

Re: GzipOutputStream is slower than gziping the file by hand

2009-07-15 Thread Kenton Varda
Hmm, probably GzipOutputStream is not setting the same compression parameters as gzip itself uses by default. I'm happy to accept a patch fixing this. Does the interface (to GzipOutputStream) currently have a way to control compression parameters? If not, it probably should. On Wed, Jul 15,

Re: GzipOutputStream is slower than gziping the file by hand

2009-07-15 Thread Peter Keen
It doesn't look like it has an existing interface for setting zlib options. Reading through the source[1], it looks like it chooses Z_BEST_COMPRESSION (-9 to the gzip command line program) whereas gzip defaults to -6. I'll work up a patch to pass the compression value through as another option to