使用SonarQube 5.6.1,几乎激活了Java Analyzer中的每个可用规则(v4.2 - 质量简介is attached here),构建和分析了一个大型项目(~2M LoC),用于运行在不到3小时内,现在需要超过12小时(!)。分析日志显示以下内容:
[INFO] ======== Profiling of total execution: 647min 3s ========
[INFO]
[INFO] * Module execution time breakdown:
[INFO] o Xxx 1.15.4-PCF execution time: 642min 42s (99%)
[INFO] o Yyy 1.15.4-PCF execution time: 3min 58s (0%)
[INFO] o Zzz 1.15.4-PCF execution time: 20s (0%)
[INFO] o Xxxx 1.15.4-PCF execution time: 395ms (0%)
[INFO] o Yyyy 1.15.4-PCF execution time: 252ms (0%)
[INFO] o Zzzz execution time: 244ms (0%)
[INFO]
[INFO] * Sensors execution time: 642min 48s (99%)
[INFO] * Publish report execution time: 3min 53s (0%)
[INFO] * Index filesystem execution time: 13s (0%)
[INFO] * Computing duplications execution time: 5s (0%)
[INFO] * Init issue exclusions execution time: 26ms (0%)
[INFO] * Clean memory execution time: 18ms (0%)
[INFO] * Initializers execution time: 2ms (0%)
[INFO] * Post-Jobs execution time: 0ms (0%)
[INFO]
[INFO] * Sensors execution time breakdown: 642min 48s
[INFO] o JavaSquidSensor: 571min 45s (88%)
[INFO] o SCM Sensor: 52min 6s (8%)
[INFO] o FindBugs Sensor: 16min 4s (2%)
[INFO] o CPD Block Indexer: 47s (0%)
[INFO] o JavaScript Squid Sensor: 34s (0%)
[INFO] o JaCoCoSensor: 25s (0%)
[INFO] o JaCoCoOverallSensor: 20s (0%)
[INFO] o Code Colorizer Sensor: 15s (0%)
[INFO] o JaCoCoItSensor: 11s (0%)
[INFO] o Zero Coverage Sensor: 3s (0%)
[INFO]
[INFO] ======== End of profiling of total execution ========
显然,在JavaSquidSensor中花费大约10小时远远不能接受。
我们最近从SonarQube 5.4到5.6.1进行了升级。 Java插件也已升级,但我不记得升级前它是哪个版本。从那以后,我可以看到性能的显着下降。
如何追踪导致该规则的特定规则(除了普通的二分法......没有时间花在此上)
在较小的分析中使用分析器,我无法识别瓶颈 - 实现似乎非常递归,大部分时间都花在访问者类中 - 请参阅附件截图。
非常感谢任何帮助:)