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

Add zstd compression support to SAPM client #138

Merged

Conversation

tigrannajaryan
Copy link
Collaborator

I added a simple benchmark of compression methods and a test to print compressed byte sizes. Take with a grain of salt since the input is based on just one trivial data generator and may not be representative of production loads.

For the inputs used zstd wins both in compression size and speed (more apparent in larger input sizes).

Compression Sizes

=== RUN   TestCompressionSize
Message byte size by batch and compression method.
Compression       none      gzip      zstd
Batch=1            148       139       135
Batch=10          1558       503       490
Batch=100        15958      2495      2360
Batch=1000      161590     22110     22978
Batch=10000    1644106    222217    181468
--- PASS: TestCompressionSize (0.13s)

Benchmark

BenchmarkCompression/none/batch=1-8                56662             85501 ns/op          233172 B/op         28 allocs/op
BenchmarkCompression/gzip/batch=1-8                27688             64055 ns/op          117560 B/op         35 allocs/op
BenchmarkCompression/zstd/batch=1-8                41965             69071 ns/op          174616 B/op         33 allocs/op
BenchmarkCompression/none/batch=100-8              20131             63991 ns/op          117124 B/op        325 allocs/op
BenchmarkCompression/gzip/batch=100-8               3043            408736 ns/op           54255 B/op        335 allocs/op
BenchmarkCompression/zstd/batch=100-8              10276            120161 ns/op           80178 B/op        330 allocs/op
BenchmarkCompression/none/batch=1000-8              3066            382949 ns/op          323067 B/op       3025 allocs/op
BenchmarkCompression/gzip/batch=1000-8               243           4787768 ns/op          379947 B/op       3038 allocs/op
BenchmarkCompression/zstd/batch=1000-8              1128           1014972 ns/op          391926 B/op       3034 allocs/op

I added a simple benchmark of compression methods and a test to print compressed
byte sizes. Take with a grain of salt since the input is based on just one trivial
data generator and may not be representative of production loads.

For the inputs used zstd wins both in compression size and speed (more apparent in
larger input sizes).

## Compression Sizes

```
=== RUN   TestCompressionSize
Message byte size by batch and compression method.
Compression       none      gzip      zstd
Batch=1            148       139       135
Batch=10          1558       503       490
Batch=100        15958      2495      2360
Batch=1000      161590     22110     22978
Batch=10000    1644106    222217    181468
--- PASS: TestCompressionSize (0.13s)
```

## Benchmark

```
BenchmarkCompression/none/batch=1-8                56662             85501 ns/op          233172 B/op         28 allocs/op
BenchmarkCompression/gzip/batch=1-8                27688             64055 ns/op          117560 B/op         35 allocs/op
BenchmarkCompression/zstd/batch=1-8                41965             69071 ns/op          174616 B/op         33 allocs/op
BenchmarkCompression/none/batch=100-8              20131             63991 ns/op          117124 B/op        325 allocs/op
BenchmarkCompression/gzip/batch=100-8               3043            408736 ns/op           54255 B/op        335 allocs/op
BenchmarkCompression/zstd/batch=100-8              10276            120161 ns/op           80178 B/op        330 allocs/op
BenchmarkCompression/none/batch=1000-8              3066            382949 ns/op          323067 B/op       3025 allocs/op
BenchmarkCompression/gzip/batch=1000-8               243           4787768 ns/op          379947 B/op       3038 allocs/op
BenchmarkCompression/zstd/batch=1000-8              1128           1014972 ns/op          391926 B/op       3034 allocs/op
```
@tigrannajaryan tigrannajaryan marked this pull request as ready for review May 31, 2023 14:32
@tigrannajaryan tigrannajaryan requested review from a team as code owners May 31, 2023 14:32
Copy link
Contributor

@dmitryax dmitryax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tigrannajaryan tigrannajaryan merged commit 755ac0a into signalfx:main Jun 8, 2023
@tigrannajaryan tigrannajaryan deleted the feature/tigran/clientzstd branch June 8, 2023 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants