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

Allocate entries array with correct size while decoding WAL entries. #3241

Merged
merged 1 commit into from
Jan 27, 2021

Conversation

cyriltovena
Copy link
Contributor

Small optimization I found while deployment the new version.
We might want to have a pool of entries here.

❯ benchcmp  before.txt after.txt
benchmark                  old ns/op     new ns/op     delta
Benchmark_DecodeWAL-16     2350024       1591633       -32.27%

benchmark                  old allocs     new allocs     delta
Benchmark_DecodeWAL-16     20043          20005          -0.19%

benchmark                  old bytes     new bytes     delta
Benchmark_DecodeWAL-16     4946246       1763270       -64.35%

Signed-off-by: Cyril Tovena cyril.tovena@gmail.com

Small optimization I found while deployment the new version.
We might want to have a pool of entries here.

```
❯ benchcmp  before.txt after.txt
benchmark                  old ns/op     new ns/op     delta
Benchmark_DecodeWAL-16     2350024       1591633       -32.27%

benchmark                  old allocs     new allocs     delta
Benchmark_DecodeWAL-16     20043          20005          -0.19%

benchmark                  old bytes     new bytes     delta
Benchmark_DecodeWAL-16     4946246       1763270       -64.35%
```

Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
@owen-d owen-d merged commit 8716e24 into grafana:master Jan 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants