Is it significantly faster to find all classes wit...
# ksp
c
Is it significantly faster to find all classes with a particular annotation than to find all inheritors of a particular interface?
j
These 2 actions are not same actions anyway. Generally I would say blindly finding all inheritors of a particular interface will be slower as you need to traverse all classes and check their super types. But if you are looking at a sealed interface, it will get faster.
e
@Jiaxiang just curious, why will it be faster for sealed interfaces, is there some special resolution logic around this?
j
Compiler comes with sealed subclass support so KSP can simply query compiler for that matter instead of traversing all classes in the project. The more detailed explanation on why compiler supports it is probably not relevant here for KSP’s purpose.
e
Yeah thats answers my question, thanks!