Riverside-Software / sonar-openedge

CABL (Code Analyzer for ABL in SonarQube) - ABL ANTLR4 Parser
https://riverside-software.fr
GNU Lesser General Public License v3.0
63 stars 26 forks source link

Scanner Performance issue after installing 2.24 #1097

Closed ccecvb closed 11 months ago

ccecvb commented 11 months ago

I noticed our sonarscan is taking a lot longer now than before.

scan now, build 151, using 2.24.x, takes 1 hour 14 minutes image

15:13:15  INFO: ------------------------------------------------------------------------
15:13:15  INFO: EXECUTION SUCCESS
15:13:15  INFO: ------------------------------------------------------------------------
15:13:15  INFO: Total time: 1:14:13.409s
15:13:15  INFO: Final Memory: 550M/2048M
15:13:15  INFO: ------------------------------------------------------------------------

same scan build 148, before using snapshot 2.25, took 26 minutes image

01:40:44  INFO: ------------------------------------------------------------------------
01:40:44  INFO: EXECUTION SUCCESS
01:40:44  INFO: ------------------------------------------------------------------------
01:40:44  INFO: Total time: 26:45.943s
01:40:45  INFO: Final Memory: 550M/2048M
01:40:45  INFO: ------------------------------------------------------------------------

One difference on our side is that build 150 was during office hours and build 148 was during the night. I should have data of the next nightly build tomorrow. I also activated a few extra rules, but I would not expect this performance impact. I'll attach full scanner logs for both builds

Versions

gquerret commented 11 months ago

Log output contains execution time of the proparse sensor, as well as execution time of each rule (search for AST Generation in log). Could you include the log here? FWIW, no difference has been spotted during regression testing.

ccecvb commented 11 months ago

found this significant difference, it causes extra 44 minutes

build 148

INFO: Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.LowerCaseKeywords | time=545494 ms

vs build 151 (got wrong number before)

INFO: Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.KeywordCase | time=1593736 ms

and apparently I forgot to turn off the deprecated one

INFO: Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.LowerCaseKeywords | time=1622626 ms

I'll attach the logs

gquerret commented 11 months ago
ccecvb commented 11 months ago

scan148.log scan151.log scan152.log

gquerret commented 11 months ago

Just had a look at the version number of the plugins. Build 148 is using 2.25.0-SNAPSHOT that I sent you, while builds 151 and 152 are using 2.24.2. There's strictly no difference between those two versions except for the IndentationCheck rule, so the difference is coming from your systems.

gquerret commented 11 months ago

I think the number iof detections did not change but I don't know how to verify this . Is there a way to detect the number of violations in the log or check in sonarqube; old and new rule report same amount in current log

You can check the Activity tab on the project. You can see the total number of issues over time.

gquerret commented 11 months ago

If you have hundreds of thousands or millions of issues being reported by this rule, you can expect it to take quite some time. As an example, on a 1M LOC project, where the coding standard is uppercase, it takes 11 seconds to execute the rule to report lowercase keywords. If I switch the config to report uppercase keywords, then it takes 230 seconds to execute the rule (and report 1.5 million issues).

ccecvb commented 11 months ago

@gquerret FYI the Activity tab indication shows a growth consistent with testing the same issue with 2 rules, new and deprecated. I'll drop the rule from the scanner rules and try use it only in SonarLint interactive checking.