Skip to content

Conversation

bentatham
Copy link

@bentatham bentatham commented Oct 3, 2025

  • Improve performance of IntelliJ IDEA formatter by batching files for each invocation of idea executable.

Note: this PR heavily relied on copilot to assist.

@bentatham bentatham force-pushed the feature/idea-batches branch from 475ba64 to 4acd83c Compare October 3, 2025 18:20
Copy link
Member

@nedtwigg nedtwigg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be amazing for the idea formatter to be more usable in Spotless. Thanks for taking a shot at it! Have you tested this locally on a large project and seen a speedup?

Because Spotless does formatting one file at a time, I would not expect this to be much of a speedup unless we broke correctness. But if you have impressive benchmarking results please share them, otherwise I will probably close this approach as unlikely to work.

Comment on lines +427 to +429
void cacheFormattedResult(File originalFile, String formatted) {
formattedCache.put(originalFile, formatted);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unfortunately, I don't think using the File alone is sufficient for a key. The key needs to include the file's content. This is because there are other steps which will operate on the file before or after the idea step.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants