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

create functional builder #8

Merged
merged 6 commits into from
Oct 8, 2023
Merged

create functional builder #8

merged 6 commits into from
Oct 8, 2023

Conversation

wazazaby
Copy link
Owner

@wazazaby wazazaby commented Oct 6, 2023

benchstat results against the standard "builder pattern" builder.

goos: darwin
goarch: arm64
pkg: github.com/wazazaby/vimebu
                                                          │ builder.txt │              func.txt               │
                                                          │   sec/op    │   sec/op     vs base                │
BuilderTestCases/metric_with_labels-10                      68.60n ± 0%   64.37n ± 3%   -6.17% (p=0.000 n=15)
BuilderTestCases/metric_with_single_label-10                49.33n ± 0%   46.44n ± 0%   -5.86% (p=0.000 n=15)
BuilderTestCases/metric_without_label-10                    34.98n ± 0%   22.19n ± 0%  -36.56% (p=0.000 n=15)
BuilderTestCases/some_empty_labels_and_values-10            57.57n ± 1%   51.93n ± 0%   -9.80% (p=0.000 n=15)
BuilderTestCases/values_contain_double_quotes-10            473.9n ± 1%   470.7n ± 1%        ~ (p=0.076 n=15)
BuilderTestCases/values_with_and_without_double_quotes-10   509.1n ± 1%   504.0n ± 1%   -1.00% (p=0.001 n=15)
geomean                                                     108.6n        96.69n       -11.00%

                                                          │ builder.txt │              func.txt               │
                                                          │    B/op     │    B/op     vs base                 │
BuilderTestCases/metric_with_labels-10                       64.00 ± 0%   64.00 ± 0%       ~ (p=1.000 n=15) ¹
BuilderTestCases/metric_with_single_label-10                 32.00 ± 0%   32.00 ± 0%       ~ (p=1.000 n=15) ¹
BuilderTestCases/metric_without_label-10                     32.00 ± 0%   32.00 ± 0%       ~ (p=1.000 n=15) ¹
BuilderTestCases/some_empty_labels_and_values-10             48.00 ± 0%   48.00 ± 0%       ~ (p=1.000 n=15) ¹
BuilderTestCases/values_contain_double_quotes-10             112.0 ± 0%   112.0 ± 0%       ~ (p=1.000 n=15) ¹
BuilderTestCases/values_with_and_without_double_quotes-10    160.0 ± 0%   160.0 ± 0%       ~ (p=1.000 n=15) ¹
geomean                                                      61.92        61.92       +0.00%
¹ all samples are equal

                                                          │ builder.txt │              func.txt               │
                                                          │  allocs/op  │ allocs/op   vs base                 │
BuilderTestCases/metric_with_labels-10                       1.000 ± 0%   1.000 ± 0%       ~ (p=1.000 n=15) ¹
BuilderTestCases/metric_with_single_label-10                 1.000 ± 0%   1.000 ± 0%       ~ (p=1.000 n=15) ¹
BuilderTestCases/metric_without_label-10                     1.000 ± 0%   1.000 ± 0%       ~ (p=1.000 n=15) ¹
BuilderTestCases/some_empty_labels_and_values-10             1.000 ± 0%   1.000 ± 0%       ~ (p=1.000 n=15) ¹
BuilderTestCases/values_contain_double_quotes-10             1.000 ± 0%   1.000 ± 0%       ~ (p=1.000 n=15) ¹
BuilderTestCases/values_with_and_without_double_quotes-10    1.000 ± 0%   1.000 ± 0%       ~ (p=1.000 n=15) ¹
geomean                                                      1.000        1.000       +0.00%
¹ all samples are equal

@wazazaby wazazaby added the enhancement New feature or request label Oct 6, 2023
@wazazaby wazazaby self-assigned this Oct 6, 2023
@wazazaby wazazaby force-pushed the feature/pool branch 8 times, most recently from af34b8f to 87f1563 Compare October 8, 2023 13:49
@wazazaby wazazaby changed the title create builder using bytes.Buffer pool create functional builder Oct 8, 2023
@wazazaby wazazaby marked this pull request as ready for review October 8, 2023 14:18
@wazazaby wazazaby merged commit 5aa1db3 into master Oct 8, 2023
1 check passed
@wazazaby wazazaby deleted the feature/pool branch October 8, 2023 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant