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

feat(encoding): support more media type aliases #115

Merged
merged 1 commit into from
May 10, 2023

Conversation

abemedia
Copy link
Owner

No description provided.

@codecov
Copy link

codecov bot commented May 10, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.10 🎉

Comparison is base (a541544) 93.04% compared to head (16259e9) 93.15%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #115      +/-   ##
==========================================
+ Coverage   93.04%   93.15%   +0.10%     
==========================================
  Files          19       20       +1     
  Lines         762      774      +12     
==========================================
+ Hits          709      721      +12     
  Misses         37       37              
  Partials       16       16              
Impacted Files Coverage Δ
encoding/json/json.go 100.00% <100.00%> (ø)
encoding/msgpack/msgpack.go 100.00% <100.00%> (ø)
encoding/text/decode.go 78.65% <100.00%> (-0.47%) ⬇️
encoding/text/encode.go 96.00% <100.00%> (-0.16%) ⬇️
encoding/text/text.go 100.00% <100.00%> (ø)
encoding/xml/xml.go 100.00% <100.00%> (ø)
encoding/yaml/yaml.go 100.00% <100.00%> (ø)

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

@github-actions
Copy link
Contributor

Benchmark Result

Benchmark diff with base branch
goos: linux
goarch: amd64
pkg: github.com/abemedia/go-don
cpu: Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz
          │ bench-master.txt │         bench-new.txt          │
          │      sec/op      │    sec/op     vs base          │
Handler-2        594.0n ± 5%   569.0n ± 10%  ~ (p=0.075 n=10)

          │ bench-master.txt │         bench-new.txt          │
          │       B/op       │    B/op     vs base            │
Handler-2         72.00 ± 0%   72.00 ± 0%  ~ (p=1.000 n=10) ¹
¹ all samples are equal

          │ bench-master.txt │         bench-new.txt          │
          │    allocs/op     │ allocs/op   vs base            │
Handler-2         2.000 ± 0%   2.000 ± 0%  ~ (p=1.000 n=10) ¹
¹ all samples are equal

pkg: github.com/abemedia/go-don/encoding/json
              │ bench-master.txt │           bench-new.txt            │
              │      sec/op      │   sec/op     vs base               │
JSON/Encode-2        229.0n ± 6%   209.0n ± 5%  -8.71% (p=0.000 n=10)
JSON/Decode-2        180.2n ± 1%   178.7n ± 3%       ~ (p=1.000 n=10)
geomean              203.1n        193.3n       -4.85%

              │ bench-master.txt │            bench-new.txt            │
              │       B/op       │    B/op     vs base                 │
JSON/Encode-2         32.00 ± 0%   32.00 ± 0%       ~ (p=1.000 n=10) ¹
JSON/Decode-2         32.00 ± 0%   32.00 ± 0%       ~ (p=1.000 n=10) ¹
geomean               32.00        32.00       +0.00%
¹ all samples are equal

              │ bench-master.txt │            bench-new.txt            │
              │    allocs/op     │ allocs/op   vs base                 │
JSON/Encode-2         2.000 ± 0%   2.000 ± 0%       ~ (p=1.000 n=10) ¹
JSON/Decode-2         2.000 ± 0%   2.000 ± 0%       ~ (p=1.000 n=10) ¹
geomean               2.000        2.000       +0.00%
¹ all samples are equal

pkg: github.com/abemedia/go-don/encoding/msgpack
                 │ bench-master.txt │           bench-new.txt            │
                 │      sec/op      │   sec/op     vs base               │
Msgpack/Encode-2        438.3n ± 6%   472.0n ± 8%  +7.69% (p=0.001 n=10)
Msgpack/Decode-2        521.1n ± 4%   501.7n ± 2%  -3.72% (p=0.011 n=10)
geomean                 477.9n        486.6n       +1.82%

                 │ bench-master.txt │            bench-new.txt            │
                 │       B/op       │    B/op     vs base                 │
Msgpack/Encode-2         128.0 ± 0%   128.0 ± 0%       ~ (p=1.000 n=10) ¹
Msgpack/Decode-2         67.00 ± 0%   67.00 ± 0%       ~ (p=1.000 n=10) ¹
geomean                  92.61        92.61       +0.00%
¹ all samples are equal

                 │ bench-master.txt │            bench-new.txt            │
                 │    allocs/op     │ allocs/op   vs base                 │
Msgpack/Encode-2         3.000 ± 0%   3.000 ± 0%       ~ (p=1.000 n=10) ¹
Msgpack/Decode-2         3.000 ± 0%   3.000 ± 0%       ~ (p=1.000 n=10) ¹
geomean                  3.000        3.000       +0.00%
¹ all samples are equal

pkg: github.com/abemedia/go-don/encoding/text
              │ bench-master.txt │           bench-new.txt            │
              │      sec/op      │   sec/op     vs base               │
Text/Encode-2        92.38n ± 6%   88.77n ± 3%  -3.91% (p=0.019 n=10)
Text/Decode-2        58.08n ± 2%   60.92n ± 5%  +4.89% (p=0.000 n=10)
geomean              73.25n        73.54n       +0.39%

              │ bench-master.txt │            bench-new.txt            │
              │       B/op       │    B/op     vs base                 │
Text/Encode-2         24.00 ± 0%   24.00 ± 0%       ~ (p=1.000 n=10) ¹
Text/Decode-2         16.00 ± 0%   16.00 ± 0%       ~ (p=1.000 n=10) ¹
geomean               19.60        19.60       +0.00%
¹ all samples are equal

              │ bench-master.txt │            bench-new.txt            │
              │    allocs/op     │ allocs/op   vs base                 │
Text/Encode-2         2.000 ± 0%   2.000 ± 0%       ~ (p=1.000 n=10) ¹
Text/Decode-2         1.000 ± 0%   1.000 ± 0%       ~ (p=1.000 n=10) ¹
geomean               1.414        1.414       +0.00%
¹ all samples are equal

pkg: github.com/abemedia/go-don/encoding/xml
             │ bench-master.txt │           bench-new.txt            │
             │      sec/op      │   sec/op     vs base               │
XML/Encode-2        2.345µ ± 1%   2.464µ ± 5%  +5.07% (p=0.019 n=10)
XML/Decode-2        2.864µ ± 5%   3.032µ ± 6%  +5.85% (p=0.034 n=10)
geomean             2.592µ        2.733µ       +5.46%

             │ bench-master.txt │             bench-new.txt             │
             │       B/op       │     B/op      vs base                 │
XML/Encode-2       4.359Ki ± 0%   4.359Ki ± 0%       ~ (p=1.000 n=10) ¹
XML/Decode-2       1.086Ki ± 0%   1.086Ki ± 0%       ~ (p=1.000 n=10) ¹
geomean            2.176Ki        2.176Ki       +0.00%
¹ all samples are equal

             │ bench-master.txt │            bench-new.txt            │
             │    allocs/op     │ allocs/op   vs base                 │
XML/Encode-2         8.000 ± 0%   8.000 ± 0%       ~ (p=1.000 n=10) ¹
XML/Decode-2         23.00 ± 0%   23.00 ± 0%       ~ (p=1.000 n=10) ¹
geomean              13.56        13.56       +0.00%
¹ all samples are equal

pkg: github.com/abemedia/go-don/encoding/yaml
              │ bench-master.txt │            bench-new.txt            │
              │      sec/op      │   sec/op     vs base                │
YAML/Encode-2        4.866µ ± 3%   4.735µ ± 2%        ~ (p=0.089 n=10)
YAML/Decode-2        7.795µ ± 7%   6.984µ ± 3%  -10.40% (p=0.000 n=10)
geomean              6.158µ        5.750µ        -6.63%

              │ bench-master.txt │             bench-new.txt             │
              │       B/op       │     B/op      vs base                 │
YAML/Encode-2       6.555Ki ± 0%   6.555Ki ± 0%       ~ (p=1.000 n=10) ¹
YAML/Decode-2       6.602Ki ± 0%   6.602Ki ± 0%       ~ (p=1.000 n=10) ¹
geomean             6.578Ki        6.578Ki       +0.00%
¹ all samples are equal

              │ bench-master.txt │            bench-new.txt            │
              │    allocs/op     │ allocs/op   vs base                 │
YAML/Encode-2         19.00 ± 0%   19.00 ± 0%       ~ (p=1.000 n=10) ¹
YAML/Decode-2         42.00 ± 0%   42.00 ± 0%       ~ (p=1.000 n=10) ¹
geomean               28.25        28.25       +0.00%
¹ all samples are equal

@abemedia abemedia merged commit d88115c into master May 10, 2023
@abemedia abemedia deleted the feat/encoding-mime-types branch May 10, 2023 20:33
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