Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
daipom opened this issue Nov 2, 2024 · 0 comments

Comments

@daipom
Copy link
Contributor

daipom commented Nov 2, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant