Skip to content

perf: reduce unnecessary allocations in NewSHA1 and NewMD5#195

Open
anatoly-kussul wants to merge 1 commit intogoogle:masterfrom
anatoly-kussul:hash-allocs
Open

perf: reduce unnecessary allocations in NewSHA1 and NewMD5#195
anatoly-kussul wants to merge 1 commit intogoogle:masterfrom
anatoly-kussul:hash-allocs

Conversation

@anatoly-kussul
Copy link

Resubmit of accidentally closed #181 by deleting forked repo.

goos: linux
goarch: amd64
pkg: github.com/google/uuid
cpu: 12th Gen Intel(R) Core(TM) i5-12400F
                      │     old     │                 new                 │
                      │   sec/op    │   sec/op     vs base                │
MD5-12                  163.2n ± 0%   106.2n ± 0%  -34.95% (p=0.000 n=10)
SHA1-12                 176.0n ± 1%   115.8n ± 1%  -34.18% (p=0.000 n=10)

                      │     old      │                   new                   │
                      │     B/op     │    B/op     vs base                     │
MD5-12                  144.0 ± 0%       0.0 ± 0%  -100.00% (p=0.000 n=10)
SHA1-12                 168.0 ± 0%       0.0 ± 0%  -100.00% (p=0.000 n=10)

                      │     old      │                   new                   │
                      │  allocs/op   │ allocs/op   vs base                     │
MD5-12                  4.000 ± 0%     0.000 ± 0%  -100.00% (p=0.000 n=10)
SHA1-12                 4.000 ± 0%     0.000 ± 0%  -100.00% (p=0.000 n=10)

@anatoly-kussul anatoly-kussul requested a review from a team as a code owner July 1, 2025 16:45
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.

1 participant