Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KSP2 Performance Issues #2282

Open
ZacSweers opened this issue Dec 30, 2024 · 6 comments
Open

KSP2 Performance Issues #2282

ZacSweers opened this issue Dec 30, 2024 · 6 comments

Comments

@ZacSweers
Copy link
Contributor

(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
Image
Image
Image

@bcorso
Copy link

bcorso commented Jan 14, 2025

I re-profiled our builds with KSP2 with 2.0.21-1.0.27.

@ZacSweers sorry if I missed it, but what is the comparison against?

Is this comparing two different versions of KSP2 or KSP1 vs KSP2 (or something else)?

@ZacSweers
Copy link
Contributor Author

Comparing against KSP1 yeah

@ZacSweers
Copy link
Contributor Author

Tested again with 2.1.10-1.0.30 but still seeing significant regressions.

ABI - ~25%-28% slower
non-abi - ~ 40%-50% slower

@ting-yuan
Copy link
Collaborator

Hello @ZacSweers, 2.1.20-1.0.32 includes a few performance fixes on the startup time of KSP2. I hope that will help overall performance and especially on non-ABI changes. Please let me know if you're still seeing any kind of performance regressions. I'd really appreciate any data / information that may guide the direction of optimizations.

@ZacSweers
Copy link
Contributor Author

ZacSweers commented Apr 1, 2025

Tested again with 2.1.20-1.0.32 with mixed results.

TL;DR

  • Smaller projects - ~20% faster
  • More intensive projects (large classpaths) - still ~15-18% slower
Image Image

(large classpath + busier processor)

Image

@ansman
Copy link
Contributor

ansman commented Apr 1, 2025

I tried KSP 2 on our large project, and this is the result:

Longest KSP task Total time spend in KSP Total build time
KSP1 13.740s (100%) 14m 24.981s (100%) 5m 57.983s (100%)
KSP2 (1.0.31) 25.218s (184%) 15m 40.957s (109%) 5m 44.658s (96%)
KSP2 (1.0.32) 20.842s (152%) 11m 36.319s (81%) 4m 59.995s (84%)

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

No branches or pull requests

4 participants