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

fix(backend): reduce number of memory allocations #1786

Merged
merged 1 commit into from
May 28, 2020
Merged

Conversation

prymitive
Copy link
Owner

No description provided.

@prymitive
Copy link
Owner Author

Go benchmark diff

name                               old time/op        new time/op        delta
pkg:github.com/prymitive/karma/cmd/karma goos:linux goarch:amd64
Compress/Run-2                           5.19ms ± 1%        5.37ms ± 2%   +3.53%  (p=0.000 n=20+20)
Decompress/Run-2                         3.49ms ± 1%        3.67ms ± 3%   +5.15%  (p=0.000 n=20+20)
CompressionAndDecompression/Run-2        9.14ms ± 4%        9.25ms ± 2%     ~     (p=0.096 n=20+20)
PullAlerts/0.17.0-2                      5.90ms ± 5%        5.77ms ± 2%   -2.28%  (p=0.005 n=20+18)
AlertsAPIMisses/0.17.0-2                 1.27ms ± 4%        1.29ms ± 3%   +1.14%  (p=0.018 n=19+20)
AlertsAPIHits/0.17.0-2                    848µs ± 1%         845µs ± 4%     ~     (p=0.055 n=20+18)
pkg:github.com/prymitive/karma/internal/alertmanager goos:linux goarch:amd64
DedupAlerts/Run-2                         134µs ± 2%         131µs ± 3%   -2.30%  (p=0.000 n=19+19)
DedupAutocomplete/Run-2                  88.8µs ± 2%        82.4µs ± 1%   -7.25%  (p=0.000 n=20+20)
DedupColors/Run-2                        20.7µs ± 1%        18.5µs ± 1%  -10.64%  (p=0.000 n=20+20)

name                               old %/compression  new %/compression  delta
pkg:github.com/prymitive/karma/cmd/karma goos:linux goarch:amd64
Compress/Run-2                             0.04 ± 0%          0.04 ± 0%     ~     (all equal)

name                               old B/alloc        new B/alloc        delta
pkg:github.com/prymitive/karma/cmd/karma goos:linux goarch:amd64
Compress/Run-2                            4.88M ± 0%         4.88M ± 0%   -0.11%  (p=0.000 n=19+19)
Decompress/Run-2                          3.00M ± 0%         2.99M ± 0%   -0.28%  (p=0.000 n=20+20)
CompressionAndDecompression/Run-2         4.89M ± 0%         4.88M ± 0%   -0.11%  (p=0.000 n=20+19)
PullAlerts/0.17.0-2                       2.95M ± 0%         2.95M ± 0%   -0.26%  (p=0.000 n=20+20)
AlertsAPIMisses/0.17.0-2                  3.35M ± 0%         3.34M ± 0%   -0.23%  (p=0.000 n=19+19)
AlertsAPIHits/0.17.0-2                    3.31M ± 0%         3.31M ± 0%   -0.23%  (p=0.000 n=17+17)

name                               old alloc/op       new alloc/op       delta
pkg:github.com/prymitive/karma/cmd/karma goos:linux goarch:amd64
Compress/Run-2                           1.13MB ± 0%        1.13MB ± 0%     ~     (all equal)
Decompress/Run-2                         4.24MB ± 0%        4.24MB ± 0%   -0.00%  (p=0.000 n=20+20)
CompressionAndDecompression/Run-2        5.38MB ± 0%        5.38MB ± 0%   -0.00%  (p=0.000 n=20+18)
PullAlerts/0.17.0-2                      1.30MB ± 0%        1.25MB ± 0%   -4.23%  (p=0.000 n=20+19)
AlertsAPIMisses/0.17.0-2                 1.27MB ± 0%        1.27MB ± 0%   +0.36%  (p=0.000 n=19+20)
AlertsAPIHits/0.17.0-2                    311kB ± 1%         312kB ± 1%     ~     (p=0.102 n=20+20)
pkg:github.com/prymitive/karma/internal/alertmanager goos:linux goarch:amd64
DedupAlerts/Run-2                        75.5kB ± 0%        75.9kB ± 0%   +0.52%  (p=0.000 n=20+20)
DedupAutocomplete/Run-2                  45.7kB ± 0%        39.9kB ± 0%  -12.59%  (p=0.000 n=20+19)
DedupColors/Run-2                        7.34kB ± 0%        6.28kB ± 0%  -14.49%  (p=0.000 n=17+17)

name                               old allocs/op      new allocs/op      delta
pkg:github.com/prymitive/karma/cmd/karma goos:linux goarch:amd64
Compress/Run-2                             31.0 ± 0%          31.0 ± 0%     ~     (all equal)
Decompress/Run-2                           80.0 ± 0%          80.0 ± 0%     ~     (all equal)
CompressionAndDecompression/Run-2           111 ± 0%           111 ± 0%     ~     (all equal)
PullAlerts/0.17.0-2                       22.5k ± 0%         22.3k ± 0%   -0.97%  (p=0.000 n=20+19)
AlertsAPIMisses/0.17.0-2                  5.95k ± 0%         5.92k ± 0%   -0.46%  (p=0.000 n=20+20)
AlertsAPIHits/0.17.0-2                    2.32k ± 0%         2.32k ± 0%   -0.03%  (p=0.000 n=20+20)
pkg:github.com/prymitive/karma/internal/alertmanager goos:linux goarch:amd64
DedupAlerts/Run-2                           428 ± 0%           396 ± 0%   -7.48%  (p=0.000 n=20+20)
DedupAutocomplete/Run-2                     132 ± 0%           123 ± 0%   -6.82%  (p=0.000 n=20+20)
DedupColors/Run-2                          50.0 ± 0%          43.0 ± 0%  -14.00%  (p=0.000 n=20+20)

@prymitive prymitive merged commit fbef0ae into master May 28, 2020
@prymitive prymitive deleted the backend-perf branch May 28, 2020 17:44
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant