This is a simple benchmark comparing a few different possible kotlin-reflect implementations:
DESCRIPTORS
– the current implementation which uses K1 descriptorsDESCRIPTORS_WITH_METADATA
– create a descriptor, but then extract protobuf, create aKmClass
from it and use its propertiesMETADATA
– createKmClass
directly from@kotlin.Metadata
RAW_PROTOBUF
– read@kotlin.Metadata
, and then manually extract the needed data from the protobuf
This benchmark depends on a locally built kotlin-reflect from this branch:
https://github.com/JetBrains/kotlin/tree/udalov-reflect
(Run ./gradlew dist install
)
Run benchmark via:
./gradlew cleanJmh jmh