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

Parallelized opentelemetry-go/sdk/resource/auto.go Detect function #5402

Closed
wants to merge 0 commits into from

Conversation

OrHayat
Copy link

@OrHayat OrHayat commented May 22, 2024

thats solves #5401

> benchstat  ./old.txt ./new.txt
goos: linux
goarch: amd64
pkg: go.opentelemetry.io/otel/sdk/resource
cpu: 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz
                                         │  ./old.txt  │               ./new.txt                │
                                         │   sec/op    │    sec/op      vs base                 │
Detectors/instantDetector/1-detectors-8    464.6n ± 1%   2765.0n ±  1%  +495.20% (p=0.000 n=10)
Detectors/instantDetector/2-detectors-8    708.8n ± 0%   4621.5n ±  0%  +552.02% (p=0.000 n=10)
Detectors/instantDetector/4-detectors-8    1.218µ ± 1%    8.688µ ±  1%  +613.34% (p=0.000 n=10)
Detectors/instantDetector/8-detectors-8    2.164µ ± 1%   20.321µ ±  1%  +839.27% (p=0.000 n=10)
Detectors/instantDetector/16-detectors-8   4.083µ ± 2%   39.527µ ±  7%  +868.09% (p=0.000 n=10)
Detectors/fastDetector/1-detectors-8       466.4n ± 1%   2772.5n ±  1%  +494.45% (p=0.000 n=10)
Detectors/fastDetector/2-detectors-8       714.0n ± 1%   4621.5n ±  0%  +547.27% (p=0.000 n=10)
Detectors/fastDetector/4-detectors-8       1.213µ ± 0%    8.623µ ±  1%  +610.84% (p=0.000 n=10)
Detectors/fastDetector/8-detectors-8       2.170µ ± 0%   19.026µ ±  1%  +776.75% (p=0.000 n=10)
Detectors/fastDetector/16-detectors-8      4.069µ ± 0%   39.655µ ±  0%  +874.56% (p=0.000 n=10)
Detectors/mediumDetector/1-detectors-8     462.3n ± 3%   2769.0n ±  0%  +498.90% (p=0.000 n=10)
Detectors/mediumDetector/2-detectors-8     710.1n ± 0%   4618.5n ±  0%  +550.40% (p=0.000 n=10)
Detectors/mediumDetector/4-detectors-8     1.214µ ± 1%    8.670µ ±  1%  +614.13% (p=0.000 n=10)
Detectors/mediumDetector/8-detectors-8     2.196µ ± 4%   18.835µ ±  1%  +757.89% (p=0.000 n=10)
Detectors/mediumDetector/16-detectors-8    4.191µ ± 3%   39.671µ ±  0%  +846.58% (p=0.000 n=10)
Detectors/slowDetector/1-detectors-8       469.9n ± 2%   2777.5n ±  0%  +491.15% (p=0.000 n=10)
Detectors/slowDetector/2-detectors-8       722.4n ± 2%   4610.5n ±  1%  +538.22% (p=0.000 n=10)
Detectors/slowDetector/4-detectors-8       1.239µ ± 2%    8.620µ ±  1%  +596.00% (p=0.000 n=10)
Detectors/slowDetector/8-detectors-8       2.209µ ± 2%   19.090µ ±  1%  +764.36% (p=0.000 n=10)
Detectors/slowDetector/16-detectors-8      4.143µ ± 2%   39.440µ ±  1%  +852.07% (p=0.000 n=10)
DefaultResource-8        				   4.060n ± 22%   3.496n ± 10%  -13.89% (p=0.001 n=9+10)
geomean                                    1.296µ         4.477µ        +646.29%

                                         │  ./old.txt   │                ./new.txt                │
                                         │     B/op     │     B/op      vs base                   │
Detectors/instantDetector/1-detectors-8      136.0 ± 0%     304.0 ± 0%  +123.53% (p=0.000 n=10)
Detectors/instantDetector/2-detectors-8      216.0 ± 0%     528.0 ± 0%  +144.44% (p=0.000 n=10)
Detectors/instantDetector/4-detectors-8      376.0 ± 0%     976.0 ± 0%  +159.57% (p=0.000 n=10)
Detectors/instantDetector/8-detectors-8      696.0 ± 0%    1872.0 ± 0%  +168.97% (p=0.000 n=10)
Detectors/instantDetector/16-detectors-8   1.305Ki ± 0%   3.578Ki ± 0%  +174.25% (p=0.000 n=10)
Detectors/fastDetector/1-detectors-8         136.0 ± 0%     304.0 ± 0%  +123.53% (p=0.000 n=10)
Detectors/fastDetector/2-detectors-8         216.0 ± 0%     528.0 ± 0%  +144.44% (p=0.000 n=10)
Detectors/fastDetector/4-detectors-8         376.0 ± 0%     976.0 ± 0%  +159.57% (p=0.000 n=10)
Detectors/fastDetector/8-detectors-8         696.0 ± 0%    1872.0 ± 0%  +168.97% (p=0.000 n=10)
Detectors/fastDetector/16-detectors-8      1.305Ki ± 0%   3.578Ki ± 0%  +174.25% (p=0.000 n=10)
Detectors/mediumDetector/1-detectors-8       136.0 ± 0%     304.0 ± 0%  +123.53% (p=0.000 n=10)
Detectors/mediumDetector/2-detectors-8       216.0 ± 0%     528.0 ± 0%  +144.44% (p=0.000 n=10)
Detectors/mediumDetector/4-detectors-8       376.0 ± 0%     976.0 ± 0%  +159.57% (p=0.000 n=10)
Detectors/mediumDetector/8-detectors-8       696.0 ± 0%    1872.0 ± 0%  +168.97% (p=0.000 n=10)
Detectors/mediumDetector/16-detectors-8    1.305Ki ± 0%   3.578Ki ± 0%  +174.25% (p=0.000 n=10)
Detectors/slowDetector/1-detectors-8         136.0 ± 0%     304.0 ± 0%  +123.53% (p=0.000 n=10)
Detectors/slowDetector/2-detectors-8         216.0 ± 0%     528.0 ± 0%  +144.44% (p=0.000 n=10)
Detectors/slowDetector/4-detectors-8         376.0 ± 0%     976.0 ± 0%  +159.57% (p=0.000 n=10)
Detectors/slowDetector/8-detectors-8         696.0 ± 0%    1872.0 ± 0%  +168.97% (p=0.000 n=10)
Detectors/slowDetector/16-detectors-8      1.305Ki ± 0%   3.578Ki ± 0%  +174.25% (p=0.000 n=10)
DefaultResource-8            			     0.000 ± 0%     0.000 ± 0%      ~ (p=1.000 n=9+10) ¹
geomean                                      400.2                      +153.47%                ¹
¹ summaries must be >0 to compute geomean

                                         │ ./old.txt  │               ./new.txt                │
                                         │ allocs/op  │  allocs/op   vs base                   │
Detectors/instantDetector/1-detectors-8    5.000 ± 0%   10.000 ± 0%  +100.00% (p=0.000 n=10)
Detectors/instantDetector/2-detectors-8    7.000 ± 0%   14.000 ± 0%  +100.00% (p=0.000 n=10)
Detectors/instantDetector/4-detectors-8    11.00 ± 0%    22.00 ± 0%  +100.00% (p=0.000 n=10)
Detectors/instantDetector/8-detectors-8    19.00 ± 0%    38.00 ± 0%  +100.00% (p=0.000 n=10)
Detectors/instantDetector/16-detectors-8   35.00 ± 0%    70.00 ± 0%  +100.00% (p=0.000 n=10)
Detectors/fastDetector/1-detectors-8       5.000 ± 0%   10.000 ± 0%  +100.00% (p=0.000 n=10)
Detectors/fastDetector/2-detectors-8       7.000 ± 0%   14.000 ± 0%  +100.00% (p=0.000 n=10)
Detectors/fastDetector/4-detectors-8       11.00 ± 0%    22.00 ± 0%  +100.00% (p=0.000 n=10)
Detectors/fastDetector/8-detectors-8       19.00 ± 0%    38.00 ± 0%  +100.00% (p=0.000 n=10)
Detectors/fastDetector/16-detectors-8      35.00 ± 0%    70.00 ± 0%  +100.00% (p=0.000 n=10)
Detectors/mediumDetector/1-detectors-8     5.000 ± 0%   10.000 ± 0%  +100.00% (p=0.000 n=10)
Detectors/mediumDetector/2-detectors-8     7.000 ± 0%   14.000 ± 0%  +100.00% (p=0.000 n=10)
Detectors/mediumDetector/4-detectors-8     11.00 ± 0%    22.00 ± 0%  +100.00% (p=0.000 n=10)
Detectors/mediumDetector/8-detectors-8     19.00 ± 0%    38.00 ± 0%  +100.00% (p=0.000 n=10)
Detectors/mediumDetector/16-detectors-8    35.00 ± 0%    70.00 ± 0%  +100.00% (p=0.000 n=10)
Detectors/slowDetector/1-detectors-8       5.000 ± 0%   10.000 ± 0%  +100.00% (p=0.000 n=10)
Detectors/slowDetector/2-detectors-8       7.000 ± 0%   14.000 ± 0%  +100.00% (p=0.000 n=10)
Detectors/slowDetector/4-detectors-8       11.00 ± 0%    22.00 ± 0%  +100.00% (p=0.000 n=10)
Detectors/slowDetector/8-detectors-8       19.00 ± 0%    38.00 ± 0%  +100.00% (p=0.000 n=10)
Detectors/slowDetector/16-detectors-8      35.00 ± 0%    70.00 ± 0%  +100.00% (p=0.000 n=10)
DefaultResource-8          0.000 ± 0%      0.000 ± 0%         ~ (p=1.000 n=9+10) ¹
geomean                                    12.07                     +100.00%                ¹
¹ summaries must be >0 to compute geomean

Copy link

linux-foundation-easycla bot commented May 22, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@OrHayat OrHayat force-pushed the parallelize_detect branch from a07d773 to d1faa6d Compare May 22, 2024 11:56
Copy link

codecov bot commented May 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.2%. Comparing base (6d45f28) to head (ba8561e).

Current head ba8561e differs from pull request most recent head f1fa383

Please upload reports for the commit f1fa383 to get more accurate results.

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #5402   +/-   ##
=====================================
  Coverage   84.2%   84.2%           
=====================================
  Files        269     269           
  Lines      22008   22027   +19     
=====================================
+ Hits       18546   18565   +19     
- Misses      3133    3134    +1     
+ Partials     329     328    -1     

see 5 files with indirect coverage changes

Copy link
Contributor

@MrAlias MrAlias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is missing performance impact evaluation.

Please provide proof this is not impacting memory usage and what impact it has on computational time.

@OrHayat OrHayat force-pushed the parallelize_detect branch from 4ec10d6 to 94416a2 Compare May 23, 2024 12:41
@OrHayat OrHayat force-pushed the parallelize_detect branch from a67333a to 565d337 Compare May 26, 2024 10:58
@OrHayat OrHayat requested review from dmathieu and MrAlias May 28, 2024 10:02
@OrHayat OrHayat force-pushed the parallelize_detect branch from fbcb3a9 to b6bc1ec Compare June 2, 2024 21:09
@dmathieu
Copy link
Member

dmathieu commented Jun 3, 2024

This will need a changelog entry.

@OrHayat OrHayat changed the title parallelized opentelemetry-go/sdk/resource/auto.go Detect function Parallelized opentelemetry-go/sdk/resource/auto.go Detect function Jun 3, 2024
@OrHayat OrHayat force-pushed the parallelize_detect branch 3 times, most recently from 1b706de to 2cd8040 Compare June 4, 2024 21:56
@OrHayat OrHayat force-pushed the parallelize_detect branch 3 times, most recently from e412862 to d971d9f Compare June 5, 2024 23:35
@OrHayat
Copy link
Author

OrHayat commented Jun 11, 2024

@MrAlias is there anything more thats missing
to get this merged?

@OrHayat OrHayat force-pushed the parallelize_detect branch 8 times, most recently from e1c98da to f1fa383 Compare June 25, 2024 20:50
@MadVikingGod
Copy link
Contributor

It looks like from your performance analysis that this takes longer to run, uses more memory, and has more allocations.

I would recommend reevaluating if running the detectors in parallel is a good idea from the data provided.

@OrHayat OrHayat closed this Sep 8, 2024
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.

4 participants