Slow kotlin sensor

Hello, since the end of November, we’ve seen a regression in sonar analysis performances while analyzing our Android app.
It looks like the scanner is stuck on one file for a few minutes before checking the other files:

15:42:59.983 INFO  0/5445 files analyzed, current file: data/models/ActionType.kt
15:43:09.983 INFO  0/5445 files analyzed, current file: data/models/ActionType.kt
15:43:19.983 INFO  0/5445 files analyzed, current file: data/models/ActionType.kt
15:43:29.983 INFO  0/5445 files analyzed, current file: data/models/ActionType.kt
15:43:39.983 INFO  0/5445 files analyzed, current file: data/models/ActionType.kt
15:43:49.984 INFO  0/5445 files analyzed, current file: data/models/ActionType.kt
15:43:59.984 INFO  0/5445 files analyzed, current file: data/models/ActionType.kt
15:44:09.984 INFO  0/5445 files analyzed, current file: data/models/ActionType.kt
15:44:19.984 INFO  0/5445 files analyzed, current file: data/models/ActionType.kt
15:44:29.985 INFO  0/5445 files analyzed, current file: data/models/ActionType.kt
15:44:39.985 INFO  0/5445 files analyzed, current file: data/models/ActionType.kt
15:44:49.985 INFO  0/5445 files analyzed, current file: data/models/ActionType.kt
15:44:59.986 INFO  0/5445 files analyzed, current file: data/models/ActionType.kt
15:45:09.986 INFO  0/5445 files analyzed, current file: data/models/ActionType.kt
15:45:19.986 INFO  0/5445 files analyzed, current file: data/models/ActionType.kt
15:45:30.035 INFO  0/5445 files analyzed, current file: data/models/ActionType.kt
15:45:40.029 INFO  151/5445 files analyzed, current file: features/ViewModel.kt
15:45:50.029 INFO  1013/5445 files analyzed, current file: features/Module.kt

Previous analysis took ~30s and now it’s ~4min.

Hey @le.flow

How are you analyzing your code? Specifically, which Scanner are you using?

I’ve been told that with the updates made to our Kotlin analyzer, analysis can be slow if using the SonarScaner CLI (in which all code is analyzed as a single module), but the performance is better using the Scanner for Maven or Scanner for Gradle.

Hi Colin,

I’m using the sonar scanner CLI.
I’ll try out the Gradle plugin, but I’m concerned that it might be slower due to the Gradle configuration process being very slow on our project.