Skip to content

Conversation

@constanca-m
Copy link
Contributor

Description

This PR introduces a couple of changes, so the processor performs better. You can see the results here:

$ benchstat old.txt new.txt
goos: linux
goarch: amd64
pkg: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor/internal
cpu: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz
                                           │    old.txt     │                new.txt                │
                                           │     sec/op     │    sec/op      vs base                │
MergeResource/From_1_Into_0-16                 99.30n ± 13%    81.12n ±  8%  -18.31% (p=0.001 n=10)
MergeResource/From_1000_Into_0-16            4021.69µ ± 11%    44.97µ ±  5%  -98.88% (p=0.000 n=10)
MergeResource/From_1_Into_1_Match-16           10.76n ±  9%    14.80n ± 23%  +37.59% (p=0.000 n=10)
MergeResource/From_1000_Into_1000_Match-16     1.658m ± 14%    2.002m ±  5%  +20.74% (p=0.004 n=10)
MergeResource/From_1000_Into_1000_50Pct-16     3.354m ±  8%    2.357m ± 21%  -29.72% (p=0.000 n=10)
ResourceProvider/ReadOnly-16                 73.7850n ±  6%   0.5283n ±  6%  -99.28% (p=0.000 n=10)
ResourceProvider/Mixed_1Pct_Write-16          188.60n ± 10%    28.93n ±  9%  -84.66% (p=0.000 n=10)
ResourceProvider/Mixed_10Pct_Write-16          775.0n ±  5%    308.9n ±  5%  -60.14% (p=0.000 n=10)
geomean                                        4.747µ          1.023µ        -78.44%

                                           │    old.txt     │                new.txt                 │
                                           │      B/op      │     B/op      vs base                  │
MergeResource/From_1_Into_0-16                 48.00 ± 0%       48.00 ± 0%        ~ (p=1.000 n=10) ¹
MergeResource/From_1000_Into_0-16            84.22Ki ± 0%     47.62Ki ± 0%  -43.45% (p=0.000 n=10)
MergeResource/From_1_Into_1_Match-16           0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
MergeResource/From_1000_Into_1000_Match-16     0.000 ± 0%       0.000 ± 0%        ~ (p=1.000 n=10) ¹
MergeResource/From_1000_Into_1000_50Pct-16   7.935Ki ± 0%     7.912Ki ± 0%   -0.29% (p=0.011 n=10)
geomean                                                   ²                 -10.83%                ²
¹ all samples are equal
² summaries must be >0 to compute geomean

                                           │    old.txt    │               new.txt                │
                                           │   allocs/op   │  allocs/op   vs base                 │
MergeResource/From_1_Into_0-16                2.000 ± 0%      2.000 ± 0%       ~ (p=1.000 n=10) ¹
MergeResource/From_1000_Into_0-16            1.011k ± 0%     1.001k ± 0%  -0.99% (p=0.000 n=10)
MergeResource/From_1_Into_1_Match-16          0.000 ± 0%      0.000 ± 0%       ~ (p=1.000 n=10) ¹
MergeResource/From_1000_Into_1000_Match-16    0.000 ± 0%      0.000 ± 0%       ~ (p=1.000 n=10) ¹
MergeResource/From_1000_Into_1000_50Pct-16    500.0 ± 0%      500.0 ± 0%       ~ (p=1.000 n=10) ¹
geomean                                                  ²                -0.20%                ²
¹ all samples are equal
² summaries must be >0 to compute geomean

@constanca-m constanca-m requested review from a team and dashpole as code owners January 6, 2026 12:22
@github-actions github-actions bot added the processor/resourcedetection Resource detection processor label Jan 6, 2026
@github-actions github-actions bot requested a review from Aneurysm9 January 6, 2026 12:22
@constanca-m constanca-m added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Jan 6, 2026
@paulojmdias paulojmdias added the ready to merge Code review completed; ready to merge by maintainers label Jan 7, 2026
@songy23 songy23 merged commit b24cb28 into open-telemetry:main Jan 7, 2026
222 of 223 checks passed
@github-actions github-actions bot added this to the next release milestone Jan 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

processor/resourcedetection Resource detection processor ready to merge Code review completed; ready to merge by maintainers Skip Changelog PRs that do not require a CHANGELOG.md entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants