Hi there! I was watching @Vladimir Dolzhenko talk about the IntelliJ Kotlin Plugin in KotlinConf23.
Here it says that the Kotlin compiler is single threaded▾
. This brings the following questions to my head:
• Are we talking about the frontend or the backend of the compiler?
• In case we’re talking about the frontend, does K2 bring multithreading compilation to the table?
• Is there any difference in behaviour for the IDE Kotlin compiler and the project compiler in terms of this threading thing?
xoangon
09/16/2023, 8:01 PM
Screenshot 2023-09-16 at 21.55.27.png
d
dmitriy.novozhilov
09/16/2023, 8:49 PM
K1 frontend is singlethreaded
IR backend is multithreaded in some parts
K2 frontend is adapted to multithreaded work, but for now it is really used only in IDE plugin
We plan to implement multithreading in frontend for compilation somewhere after 2.0
x
xoangon
09/16/2023, 10:27 PM
Nice information there. Thanks @dmitriy.novozhilov! There's something I've not completely understood, though:
• Does the current version of the K2 frontend support multithreading or will it at some point after 2.0?
d
dmitriy.novozhilov
09/17/2023, 9:10 AM
No, it doesn't
Internal structures are ready to be used from multiple threads, but there are no resources in team to implement this mode before 2.0