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

perf(encoding/text): reduce allocs #142

Merged
merged 1 commit into from
May 15, 2023
Merged

perf(encoding/text): reduce allocs #142

merged 1 commit into from
May 15, 2023

Conversation

abemedia
Copy link
Owner

No description provided.

@github-actions
Copy link
Contributor

Benchmark Results

.
goos: linux
goarch: amd64
pkg: github.com/abemedia/go-don
cpu: Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz
                         │   before    │               after                │
                         │   sec/op    │   sec/op     vs base               │
Handler/Request-2          446.8n ± 1%   453.8n ± 1%  +1.57% (p=0.006 n=10)
Handler/RequestPointer-2   524.0n ± 2%   549.4n ± 2%  +4.86% (p=0.001 n=10)
geomean                    483.8n        499.3n       +3.20%

                         │   before   │                after                │
                         │    B/op    │    B/op     vs base                 │
Handler/Request-2          24.00 ± 0%   24.00 ± 0%       ~ (p=1.000 n=10) ¹
Handler/RequestPointer-2   24.00 ± 0%   24.00 ± 0%       ~ (p=1.000 n=10) ¹
geomean                    24.00        24.00       +0.00%
¹ all samples are equal

                         │   before   │                after                │
                         │ allocs/op  │ allocs/op   vs base                 │
Handler/Request-2          1.000 ± 0%   1.000 ± 0%       ~ (p=1.000 n=10) ¹
Handler/RequestPointer-2   1.000 ± 0%   1.000 ± 0%       ~ (p=1.000 n=10) ¹
geomean                    1.000        1.000       +0.00%
¹ all samples are equal
encoding/text
goos: linux
goarch: amd64
pkg: github.com/abemedia/go-don/encoding/text
cpu: Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz
              │   before    │                after                │
              │   sec/op    │   sec/op     vs base                │
Text/Decode-2   17.73n ± 2%   16.62n ± 3%   -6.26% (p=0.000 n=10)
Text/Encode-2   90.83n ± 1%   55.83n ± 1%  -38.54% (p=0.000 n=10)
geomean         40.14n        30.46n       -24.10%

              │    before    │                after                 │
              │     B/op     │    B/op     vs base                  │
Text/Decode-2   0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
Text/Encode-2   24.00 ± 0%     16.00 ± 0%  -33.33% (p=0.000 n=10)
geomean                    ²               -18.35%                ²
¹ all samples are equal
² summaries must be >0 to compute geomean

              │    before    │                after                 │
              │  allocs/op   │ allocs/op   vs base                  │
Text/Decode-2   0.000 ± 0%     0.000 ± 0%        ~ (p=1.000 n=10) ¹
Text/Encode-2   2.000 ± 0%     1.000 ± 0%  -50.00% (p=0.000 n=10)
geomean                    ²               -29.29%                ²
¹ all samples are equal
² summaries must be >0 to compute geomean

@abemedia abemedia merged commit 5759715 into master May 15, 2023
@codecov
Copy link

codecov bot commented May 15, 2023

Codecov Report

Patch coverage: 50.00% and project coverage change: -0.35 ⚠️

Comparison is base (8674397) 96.21% compared to head (005057b) 95.87%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #142      +/-   ##
==========================================
- Coverage   96.21%   95.87%   -0.35%     
==========================================
  Files          23       23              
  Lines         845      848       +3     
==========================================
  Hits          813      813              
- Misses         22       24       +2     
- Partials       10       11       +1     
Impacted Files Coverage Δ
encoding/text/encode.go 90.56% <50.00%> (-5.44%) ⬇️
handler.go 96.72% <50.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@abemedia abemedia deleted the perf/text-encoding branch May 15, 2023 21:03
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