lipiridi / spotless-applier

An IntelliJ plugin that allows running the spotless Gradle and Maven tasks from within the IDE, either on the current file selected in the editor or for the whole project.
MIT License
21 stars 2 forks source link

Slow performance #28

Open Artur- opened 2 months ago

Artur- commented 2 months ago

This plugin is super great but it is also super slow as every save causes a new Maven process to be launched, spotless to be run, invoking formatters and in the end the file is updated. Compared to the built in IntellIj formatter, the experience is totally different.

Do you have any ideas on how to improve the performance significantly? Keep something running in the background or similar?

lipiridi commented 2 months ago

Greetings @Artur- ! The thing is, Spotless is a tool that allows you to use different formatters with their own configurations. That’s why there’s no way to call the Spotless apply function apart from a Gradle/Maven task. And yes, it’s not as fast as native IntelliJ tasks, especially for Maven.

The way to significantly improve performance is to integrate Spotless natively, which is a huge amount of work because it's essentially like integrating a new build system - https://github.com/diffplug/spotless?tab=readme-ov-file#other-build-systems