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

Utility analyzer: Enable concurrent analysis and use producer/consumer pattern for file writes #8459

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

martin-strecker-sonarsource
Copy link
Contributor

Fixes #6674
Fixes #8460

Akka test (dotnet build in Sonar context):

Run  Master (b36349a) After (c6d7e8d)  Diff
Run 1 0:01:13 0:01:12 1.62%
Run 2 0:01:11 0:01:14 -3.83%
Run 3 0:01:16 0:01:08 10.76%
Run 4 0:01:14 0:01:09 6.99%
Average 0:01:14 0:01:11 4.02%

The Utility Analyzers in Akka create 936 protobuf files with a total size of 35.195.405 bytes/35MB (ucfgs excluded). 75% of the 35MB are contributed by the CopyPasteTokenAnalyzer (token-cpd.pb).

AnalyzerRunner (Akka)
C:\Projects\OpenSource\roslyn\artifacts\bin\AnalyzerRunner\Release\net7.0\AnalyzerRunner.exe C:\Projects\sonar-dotnet\analyzers\packaging\binaries "C:\Projects\Sprints\UtilityAnalyzerPerf\Benchmark\Projects\akka.net\src\Akka.sln" /a CopyPasteTokenAnalyzer /a FileMetadataAnalyzer /a LogAnalyzer /a MetricsAnalyzer /a SymbolReferenceAnalyzer /a TokenTypeAnalyzer

Master After
Average Average Diff
CopyPasteTokenAnalyzer: 2515.50 1948.00 22.56%
FileMetadataAnalyzer: 617.25 584.75 5.27%
LogAnalyzer: 244.50 200.25 18.10%
MetricsAnalyzer: 5132.00 5046.50 1.67%
SymbolReferenceAnalyzer: 3892.75 3963.00 -1.80%
TokenTypeAnalyzer: 2392.00 2305.25 3.63%

AWS SDK

file MB
file-metadata.pb 65.63
log.pb 0.70
metrics.pb 118.76
symrefs.pb 219.60
token-cpd.pb 1951.50
token-type.pb 499.95
Run Master PR Diff
AWS 0:50:13 0:47:45 4.92%
AWS 0:49:25 0:50:46 -2.72%
AWS 0:49:40 0:48:55 1.52%
Average 0:49:46 0:49:09 1.26%

Measurement details

TODO:

  • Measure on a large-scale project (AWS?) without ucfg generation (SQ community edition):

Copy link

sonarcloud bot commented Dec 11, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Copy link

sonarcloud bot commented Dec 11, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

100.0% 100.0% Coverage
0.0% 0.0% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

@martin-strecker-sonarsource martin-strecker-sonarsource force-pushed the Martin/UtilityAnalyzer_BlockingCollection branch from c6d7e8d to 576b11f Compare January 18, 2024 13:20
Copy link

sonarcloud bot commented Jan 18, 2024

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link

sonarcloud bot commented Jan 18, 2024

Quality Gate Failed Quality Gate failed

Failed conditions

1 New issue

See analysis details on SonarCloud

idea Catch issues before they fail your Quality Gate with our IDE extension SonarLint SonarLint

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.

Utility Analyzer: Decouple file I/O from Roslyn threads UtilityAnalyzer: EnableConcurrentExecution
1 participant