https://kotlinlang.org logo
Title
f

Fudge

07/28/2021, 5:43 PM
I feel like I don't understand incremental processing in KSP on a basic level. Say my processor uses class
A
by annotating
A
and calling ``resolver.getSymbolsWithAnnotation`, and I change class `B`(unrelated). Why does
process
get called? surely to save time it should not be called. At first I thought that
resolver.getSymbolsWithAnnotation
will return an empty sequence if only
B
was changed and
A
has not, but it does not. I get
A
in this invocation, and, at the end of the day, no time is saved and there is nothing incremental about this. So what exactly can be done to make processing code incremental? There is no flag
stuffHasNotChanged
.
By the way, according to the logs, the file containing
A
is not dirty.
t

Ting-Yuan Huang

07/28/2021, 6:13 PM
A possibility is that there is an aggregating output that depends (directly or indirectly) on A.
Because an aggregating output must be invalidated for any changes (that may contain new information to that output), if A participated in the generation of that output, A will also be invalidated.
f

Fudge

07/29/2021, 2:51 PM
My processor is isolating. But the thing i want to understand most is what will happen when ksp thinks a processor should not do unnecessary work. Does it simply not call procees()?
t

Ting-Yuan Huang

07/31/2021, 5:12 AM
KSP calls process() and passes only files there are dirty / affected. It only skips process() when everything is clean.