- ALM used : Github
- CI system used : Jenkins
- Scanner command used when applicable : ./mvnw -Dsonar.pullrequest.key=20183 -Dsonar.pullrequest.branch=feature/ETECH-49256_5.13 -Dsonar.pullrequest.base=main -Dsonar.projectKey=praxedo_etech -T 1C --batch-mode sonar:sonar
Hi,
We observe bad performance for our PR build time. We used to be around 4 minutes time for a small PR but the builds have now more than doubled.
The incremental build doesn’t seem to work as well as it should. For example, this build is on a PR that has no change to java files. In the logs, we can see that most of the build is on Java files. Below is the logs of one of the many modules that is analyzed by Sonar. 1min38 on this module that contains zero change.
[INFO] 13:57:20.385 ------------- Run sensors on module etech-central
[INFO] 13:57:20.394 SonarJasmin relies on SonarSecurity to define the JS/TS security rule repositories.
[INFO] 13:57:20.436 Sensor JavaSensor [java]
[INFO] 13:57:20.436 Configured Java source version (sonar.java.source): 21, preview features enabled (sonar.java.enablePreview): false
[INFO] 13:57:20.447 The Java analyzer is running in a context where unchanged files can be skipped. Full analysis is performed for changed files, optimized analysis for unchanged files.
[INFO] 13:57:23.435 Server-side caching is enabled. The Java analyzer was able to leverage cached data from previous analyses for 1521 out of 3882 files. These files will not be parsed.
[INFO] 13:57:23.437 Using ECJ batch to parse 2360 Main java source files with batch size 385 KB.
[INFO] 13:57:23.441 Starting batch processing.
[INFO] 13:58:58.928 100% analyzed
[INFO] 13:58:58.928 Batch processing: Done.
[INFO] 13:58:58.930 Optimized analysis for 2359 of 2360 files.
[WARNING] 13:58:59.091 Unresolved imports/types have been detected during analysis. Enable DEBUG mode to see them.
[WARNING] 13:58:59.092 Use of preview features have been detected during analysis. Enable DEBUG mode to see them.
[INFO] 13:58:59.092 Using ECJ batch to parse 1 Test java source files with batch size 385 KB.
[INFO] 13:58:59.095 Starting batch processing.
[INFO] 13:58:59.277 100% analyzed
[INFO] 13:58:59.278 Batch processing: Done.
[INFO] 13:58:59.279 Did not optimize analysis for any files, performed a full analysis for all 1 files.
[WARNING] 13:58:59.279 Unresolved imports/types have been detected during analysis. Enable DEBUG mode to see them.
[INFO] 13:58:59.279 No “Generated” source files to scan.
[INFO] 13:58:59.279 Sensor JavaSensor [java] (done) | time=98843ms
[INFO] 13:58:59.280 Sensor JaCoCo XML Report Importer [jacoco]
[INFO] 13:58:59.288 Importing 1 report(s). Turn your logs in debug mode in order to see the exhaustive list.
[INFO] 13:58:59.653 Sensor JaCoCo XML Report Importer [jacoco] (done) | time=373ms
[INFO] 13:58:59.653 Sensor Java Config Sensor [iac]
[INFO] 13:58:59.683 0 source files to be analyzed
[INFO] 13:58:59.684 0/0 source files have been analyzed
[INFO] 13:58:59.684 Sensor Java Config Sensor [iac] (done) | time=31ms
[INFO] 13:58:59.684 Sensor JavaScript inside HTML analysis [javascript]
[INFO] 13:58:59.829 Detected os: Linux arch: amd64 alpine: false. Platform: LINUX_X64
[INFO] 13:58:59.830 Deploy location /home//.sonar/js/node-runtime, tagetRuntime: /home//.sonar/js/node-runtime/node, version: /home//.sonar/js/node-runtime/version.txt
[INFO] 13:59:03.081 Using embedded Node.js runtime.
[INFO] 13:59:03.082 Using Node.js executable: '/home//.sonar/js/node-runtime/node’.
[INFO] 13:59:04.820 Memory configuration: OS (29388 MB), Node.js (4144 MB).
[INFO] 13:59:04.876 1 source file to be analyzed
[INFO] 13:59:07.169 1/1 source file has been analyzed
[INFO] 13:59:07.172 Hit the cache for 1 out of 1
[INFO] 13:59:07.172 Miss the cache for 0 out of 1
[INFO] 13:59:07.172 Sensor JavaScript inside HTML analysis [javascript] (done) | time=7488ms
[INFO] 13:59:07.173 Sensor CSS Rules [javascript]
[INFO] 13:59:07.173 Sensor CSS Rules is restricted to changed files only
[INFO] 13:59:07.174 No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
[INFO] 13:59:07.174 Sensor CSS Rules [javascript] (done) | time=1ms
[INFO] 13:59:07.174 Sensor ThymeLeaf template sensor [securityjavafrontend]
[INFO] 13:59:07.181 Sensor ThymeLeaf template sensor [securityjavafrontend] (done) | time=7ms
[INFO] 13:59:07.181 Sensor SurefireSensor [java]
[INFO] 13:59:07.182 parsing [/home/****/workspace/ETECH_eTech_PR-20183/etech-central/target/surefire-reports]
[INFO] 13:59:07.182 Sensor SurefireSensor [java] (done) | time=1ms
[INFO] 13:59:07.182 Sensor HTML [web]
[INFO] 13:59:07.182 Sensor HTML is restricted to changed files only
[INFO] 13:59:07.183 Sensor HTML [web] (done) | time=1ms
[INFO] 13:59:07.183 Sensor IaC Docker Sensor [iac]
[INFO] 13:59:07.183 Sensor IaC Docker Sensor is restricted to changed files only
[INFO] 13:59:07.188 0 source files to be analyzed
[INFO] 13:59:07.188 0/0 source files have been analyzed
[INFO] 13:59:07.188 Sensor IaC Docker Sensor [iac] (done) | time=5ms
[INFO] 13:59:07.188 Sensor Serverless configuration file sensor [security]
[INFO] 13:59:07.191 0 Serverless function entries were found in the project
[INFO] 13:59:07.191 0 Serverless function handlers were kept as entrypoints
[INFO] 13:59:07.191 Sensor Serverless configuration file sensor [security] (done) | time=3ms
[INFO] 13:59:07.191 Sensor AWS SAM template file sensor [security]
[INFO] 13:59:07.193 Sensor AWS SAM template file sensor [security] (done) | time=2ms
[INFO] 13:59:07.193 Sensor AWS SAM Inline template file sensor [security]
[INFO] 13:59:07.195 Sensor AWS SAM Inline template file sensor [security] (done) | time=2ms
What could explain the performance issue and how could we optimize it ?
We also observe an increase of the build time of the main branch scan, which went from 12 minutes (in May) to 24 minutes now with seemingly no change on our side. We can’t pinpoint the root issue and do not have enough log to identify the point in time when it happened.