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

Speedup encoder #7

Merged
merged 1 commit into from
Aug 17, 2023
Merged

Speedup encoder #7

merged 1 commit into from
Aug 17, 2023

Conversation

cristaloleg
Copy link
Member

@cristaloleg cristaloleg commented Aug 16, 2023

Thanks @quasilyte for the hint to try without bytes.Buffer.

goos: darwin
goarch: arm64
pkg: github.com/cristaloleg/benches/bencode
                        │ bench_old.txt │              bench.txt              │
                        │    sec/op     │   sec/op     vs base                │
_cristalhq_Marshal-10       597.5n ± 0%   534.6n ± 0%  -10.52% (p=0.000 n=10)
_cristalhq_MarshalTo-10     431.6n ± 0%   382.9n ± 0%  -11.26% (p=0.000 n=10)

                        │ bench_old.txt  │               bench.txt               │
                        │      B/op      │     B/op      vs base                 │
_cristalhq_Marshal-10      1024.0 ± 0%       976.0 ± 0%  -4.69% (p=0.000 n=10)
_cristalhq_MarshalTo-10     0.000 ± 0%       0.000 ± 0%       ~ (p=1.000 n=10) 

                        │ bench_old.txt │              bench.txt               │
                        │   allocs/op   │ allocs/op   vs base                  │
_cristalhq_Marshal-10      4.000 ± 0%     3.000 ± 0%  -25.00% (p=0.000 n=10)
_cristalhq_MarshalTo-10    0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) 

@cristaloleg cristaloleg merged commit 89515a9 into main Aug 17, 2023
3 checks passed
@cristaloleg cristaloleg deleted the speedup-encoder branch August 17, 2023 07:07
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