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

Record attributes based on slog.Record #6

Merged
merged 8 commits into from
Jan 18, 2024

Conversation

pellared
Copy link
Owner

@pellared pellared commented Jan 17, 2024

Per open-telemetry#4809 (comment) and open-telemetry#4809 (comment)

$ benchstat old.txt new.txt
goos: linux
goarch: amd64
pkg: go.opentelemetry.io/otel/log/internal
cpu: Intel(R) Core(TM) i9-10885H CPU @ 2.40GHz
                        │    old.txt    │                 new.txt                  │
                        │    sec/op     │     sec/op      vs base                  │
Emit/noop/no_attrs-16      2.641n ±  7%     5.764n ±  4%   +118.23% (p=0.000 n=10)
Emit/noop/3_attrs-16       15.34n ±  7%     17.24n ±  4%    +12.38% (p=0.000 n=10)
Emit/noop/5_attrs-16       18.79n ±  8%     24.24n ±  4%    +28.94% (p=0.000 n=10)
Emit/noop/10_attrs-16      28.48n ± 22%    261.65n ±  4%   +818.55% (p=0.000 n=10)
Emit/noop/40_attrs-16      89.03n ±  7%   1333.00n ±  7%  +1397.16% (p=0.000 n=10)
Emit/writer/no_attrs-16    74.57n ±  8%     89.81n ±  3%    +20.44% (p=0.000 n=10)
Emit/writer/3_attrs-16     209.2n ± 11%     224.5n ±  9%     +7.26% (p=0.035 n=10)
Emit/writer/5_attrs-16     236.1n ±  3%     275.2n ± 13%    +16.54% (p=0.000 n=10)
Emit/writer/10_attrs-16    491.2n ±  7%     715.8n ±  5%    +45.73% (p=0.000 n=10)
Emit/writer/40_attrs-16    1.601µ ± 22%     3.176µ ±  8%    +98.44% (p=0.000 n=10)
Slog/no_attrs-16           173.0n ±  5%     168.7n ± 10%          ~ (p=0.315 n=10)
Slog/3_attrs-16            214.2n ±  9%     209.1n ±  3%     -2.40% (p=0.035 n=10)
Slog/5_attrs-16            268.5n ± 10%     255.7n ±  7%          ~ (p=0.075 n=10)
Slog/10_attrs-16           618.9n ± 11%    1195.5n ±  8%    +93.15% (p=0.000 n=10)
Slog/40_attrs-16           2.321µ ± 14%     6.378µ ±  3%   +174.77% (p=0.000 n=10)
Logr/no_attrs-16          15.185n ± 11%     8.824n ±  5%    -41.89% (p=0.000 n=10)
Logr/3_attrs-16            181.0n ± 10%     154.0n ±  4%    -14.87% (p=0.000 n=10)
Logr/5_attrs-16            264.6n ±  5%     246.0n ±  4%     -6.99% (p=0.000 n=10)
Logr/10_attrs-16           506.0n ±  8%    1146.0n ±  6%   +126.48% (p=0.000 n=10)
Logr/40_attrs-16           1.959µ ±  8%     6.375µ ±  5%   +225.48% (p=0.000 n=10)
geomean                    154.2n           258.5n          +67.68%

                        │    old.txt     │                 new.txt                 │
                        │      B/op      │     B/op      vs base                   │
Emit/noop/no_attrs-16       0.000 ± 0%       0.000 ± 0%         ~ (p=1.000 n=10) ¹
Emit/noop/3_attrs-16        0.000 ± 0%       0.000 ± 0%         ~ (p=1.000 n=10) ¹
Emit/noop/5_attrs-16        0.000 ± 0%       0.000 ± 0%         ~ (p=1.000 n=10) ¹
Emit/noop/10_attrs-16         0.0 ± 0%       320.0 ± 0%         ? (p=0.000 n=10)
Emit/noop/40_attrs-16     0.000Ki ± 0%     2.250Ki ± 0%         ? (p=0.000 n=10)
Emit/writer/no_attrs-16     16.00 ± 0%       16.00 ± 0%         ~ (p=1.000 n=10) ¹
Emit/writer/3_attrs-16      48.00 ± 0%       48.00 ± 0%         ~ (p=1.000 n=10) ¹
Emit/writer/5_attrs-16      48.00 ± 0%       48.00 ± 0%         ~ (p=1.000 n=10) ¹
Emit/writer/10_attrs-16     88.00 ± 0%      408.00 ± 0%  +363.64% (p=0.000 n=10)
Emit/writer/40_attrs-16     328.0 ± 0%      2632.0 ± 0%  +702.44% (p=0.000 n=10)
Slog/no_attrs-16            0.000 ± 0%       0.000 ± 0%         ~ (p=1.000 n=10) ¹
Slog/3_attrs-16             0.000 ± 0%       0.000 ± 0%         ~ (p=1.000 n=10) ¹
Slog/5_attrs-16             0.000 ± 0%       0.000 ± 0%         ~ (p=1.000 n=10) ¹
Slog/10_attrs-16            209.0 ± 0%      1168.0 ± 0%  +458.85% (p=0.000 n=10)
Slog/40_attrs-16          1.400Ki ± 0%     9.312Ki ± 0%  +564.99% (p=0.000 n=10)
Logr/no_attrs-16            0.000 ± 0%       0.000 ± 0%         ~ (p=1.000 n=10) ¹
Logr/3_attrs-16             128.0 ± 0%       128.0 ± 0%         ~ (p=1.000 n=10) ¹
Logr/5_attrs-16             208.0 ± 0%       208.0 ± 0%         ~ (p=1.000 n=10) ¹
Logr/10_attrs-16            418.0 ± 0%      1376.0 ± 0%  +229.19% (p=0.000 n=10)
Logr/40_attrs-16          1.656Ki ± 0%     9.562Ki ± 0%  +477.36% (p=0.000 n=10)
geomean                                ²                 ?                       ²
¹ all samples are equal
² summaries must be >0 to compute geomean

                        │   old.txt    │                new.txt                 │
                        │  allocs/op   │  allocs/op   vs base                   │
Emit/noop/no_attrs-16     0.000 ± 0%      0.000 ± 0%         ~ (p=1.000 n=10) ¹
Emit/noop/3_attrs-16      0.000 ± 0%      0.000 ± 0%         ~ (p=1.000 n=10) ¹
Emit/noop/5_attrs-16      0.000 ± 0%      0.000 ± 0%         ~ (p=1.000 n=10) ¹
Emit/noop/10_attrs-16     0.000 ± 0%      1.000 ± 0%         ? (p=0.000 n=10)
Emit/noop/40_attrs-16     0.000 ± 0%      1.000 ± 0%         ? (p=0.000 n=10)
Emit/writer/no_attrs-16   1.000 ± 0%      1.000 ± 0%         ~ (p=1.000 n=10) ¹
Emit/writer/3_attrs-16    4.000 ± 0%      4.000 ± 0%         ~ (p=1.000 n=10) ¹
Emit/writer/5_attrs-16    4.000 ± 0%      4.000 ± 0%         ~ (p=1.000 n=10) ¹
Emit/writer/10_attrs-16   7.000 ± 0%      8.000 ± 0%   +14.29% (p=0.000 n=10)
Emit/writer/40_attrs-16   25.00 ± 0%      26.00 ± 0%    +4.00% (p=0.000 n=10)
Slog/no_attrs-16          0.000 ± 0%      0.000 ± 0%         ~ (p=1.000 n=10) ¹
Slog/3_attrs-16           0.000 ± 0%      0.000 ± 0%         ~ (p=1.000 n=10) ¹
Slog/5_attrs-16           0.000 ± 0%      0.000 ± 0%         ~ (p=1.000 n=10) ¹
Slog/10_attrs-16          1.000 ± 0%      5.000 ± 0%  +400.00% (p=0.000 n=10)
Slog/40_attrs-16          1.000 ± 0%      8.000 ± 0%  +700.00% (p=0.000 n=10)
Logr/no_attrs-16          0.000 ± 0%      0.000 ± 0%         ~ (p=1.000 n=10) ¹
Logr/3_attrs-16           4.000 ± 0%      4.000 ± 0%         ~ (p=1.000 n=10) ¹
Logr/5_attrs-16           5.000 ± 0%      5.000 ± 0%         ~ (p=1.000 n=10) ¹
Logr/10_attrs-16          9.000 ± 0%     13.000 ± 0%   +44.44% (p=0.000 n=10)
Logr/40_attrs-16          33.00 ± 0%      40.00 ± 0%   +21.21% (p=0.000 n=10)
geomean                              ²                ?                       ²
¹ all samples are equal
² summaries must be >0 to compute geomean

@pellared pellared marked this pull request as ready for review January 17, 2024 12:03
@pellared pellared merged commit f78cbec into logs-design Jan 18, 2024
26 checks passed
@pellared pellared deleted the revert-record-with-attrs-array branch January 18, 2024 09:38
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