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

feat: snappy compression #46

Merged
merged 3 commits into from
Dec 20, 2023
Merged

Conversation

merklefruit
Copy link
Contributor

@merklefruit merklefruit commented Dec 19, 2023

Overview

Added support for the Snappy compression algorithm with the snap crate.

Benchmark

It appears snappy is super fast, while providing a more modest compression than gzip and zstd.
Here are the comparative results for a 280kb SSZ encoded Ethereum beacon block:

uncompressed data size: 287038 bytes
gzip compression shrank the data by 334.39% in 4.456125ms
zstd compression shrank the data by 389.28% in 2.543625ms
snappy compression shrank the data by 202.82% in 368.083µs
------
gzip decompression took 1.022083ms
zstd decompression took 449.75µs
snappy decompression took 247.959µs

@merklefruit merklefruit self-assigned this Dec 19, 2023
@merklefruit merklefruit added C-feature Category: Feature A-compression Area: Compression labels Dec 19, 2023
@merklefruit merklefruit changed the title feat: added compression type in header for automatic decomp feat: snappy compression Dec 19, 2023
@mempirate mempirate merged commit d3a3cd0 into feat/header-compression-type Dec 20, 2023
4 checks passed
@merklefruit merklefruit deleted the feat/snappy branch December 20, 2023 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-compression Area: Compression C-feature Category: Feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants