Skip to content

gzip compressor: stop unnecessary re-compression when the chunk is already compressed #441

Open
@daipom

Description

@daipom

Is your feature request related to a problem? Please describe.

It appears the gzip compressor of out_s3 does unnecessary re-compression when the chunk is already compressed.

class GzipCompressor < Compressor
def ext
'gz'.freeze
end
def content_type
'application/x-gzip'.freeze
end
def compress(chunk, tmp)
w = Zlib::GzipWriter.new(tmp)
chunk.write_to(w)
w.finish
ensure
w.finish rescue nil
end
end

Describe the solution you'd like

The logic should be linked to Buffer settings, like out_file.

Describe alternatives you've considered

None.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions