-
Notifications
You must be signed in to change notification settings - Fork 41
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
Unclear how to use this lib on android projects (for kotlin code) #206
Comments
I found at https://kotlinlang.org/docs/gsoc-2024.html#support-android-target-in-kotlinx-benchmark-medium-175-hrs that Android as target is not supported, but the benchmark I want to run is JVM/Kotlin-only. |
@carstenhag, do you mean it's a separate module with either Kotlin/JVM ( I'm clarifying because |
I mean a project with AGP applied :). Oh, I see, thought the android support only referred to Android Instrumented stuff. |
Then it seems like, for now, the only option you have is to use androidx.microbenchmark library (sample project). // Below is the advice you never asked for, but just in case: Note that despite the fact that a code written in Kotlin can target both JVM and Android (which is, roughly speaking, JVM bytecode further compiled to DEX), performance characteristics may vary significantly on these platforms, and benchmarking results achieved on JVM may differ from what you may get on Android device (some function So, if you're interested in measuring the performance of code that will be used in an Android app, I recommend benchmarking it on an Android device. |
I tried to follow the Kotlin/JVM setup https://github.com/Kotlin/kotlinx-benchmark/blob/master/docs/kotlin-jvm-project-setup.md but unfortunately I could not get it working.
I have added the plugin & benchmark runtime dependency and added this to the
build.gradle
:I can import the annotations, but they are giving errors.
Running
./gradlew benchmark
returns> Configure project :app Warning: Cannot find a benchmark sourceSet 'main', ignoring.
The text was updated successfully, but these errors were encountered: