google / google/ksp

KSP2 Performance Issues

Open
#2,282 7 comments 19 reactions 0 assignees View on GitHub
enhancement performance
Dominant language
Kotlin
Stars
3.5k
Forks
415
Avg merge
1d 2h
Merged PRs (30d)
53

Description

(Filing at the request of the JB folks for referencing)

I re-profiled our builds with KSP2 with 2.0.21-1.0.27. Unfortunately, across the board in a bunch of benchmarks I found that
- abi change - KSP2 is ~40-50% slower
- noabi change - KSP2 is 80-100% slower
- clean build - negligible/amortized by the clean build
-
If I just benchmark expensive our two most expensive KSP tasks with `, KSP2 is around 20-30% slower.

Other notes:
- We give the kotlin and gradle daemons the same memory, and these benchmarks were run on overpowered AWS boxes
- None of these builds were experiencing memory pressure with the settings they had (somewhere in the dozens of GB for xmx)

time-to-task-start is more or less the same, assumes a hot configuration cache

Here's a few samples. Looking again there is some GC time creeping into some of these that I'll look closer into, but not enough to majorly skew the larger trend

![Image](https://github.com/user-attachments/assets/00fad8eb-60a8-4424-9a2b-02efb1265cca)
![Image](https://github.com/user-attachments/assets/14f4189c-17c6-43c4-b51d-dfdf05d8dec1)
![Image](https://github.com/user-attachments/assets/a70cfc8f-5649-456a-ac3a-fa243a633ce0)
![Image](https://github.com/user-attachments/assets/fc88ff88-1ead-4219-8fb6-aafb58ff44b5)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.