-
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
Use Worker API for Benchmark generators #235
Conversation
e5f0f46
to
70c4cab
Compare
- Update the Benchmark JS/Wasm/Native source generation tasks to use the Worker API, so that `kotlin-compiler-embeddable` can be a compileOnly dependency, thus resolving https://youtrack.jetbrains.com/issue/KT-66764 - Create `GenerateJsSourceWorker` and `GenerateWasmSourceWorker` for isolating the JS and Wasm generation code. - Updated the Js/Wasm/Native generation tasks to invoke the source generators in a Worker isolated classpath. - Created a new Configuration for declaring `kotlin-compiler-embeddable`, and pass it to the Js/Wasm/Native generation tasks. - Create a BenchmarkDependencies utility for defining all Configurations used in the plugin. (This also lays the groundwork for unifying the JMH version #147 (comment)) - Updated BenchmarksPluginConstants to add `DEFAULT_KOTLIN_COMPILER_VERSION`, as sensible default for kotlin-compiler-embeddable. - Add opt-in annotation RequiresKotlinCompilerEmbeddable to highlight code that requires `kotlin-compiler-embeddable` - Some classes were updated to be `abstract`, to follow Gradle best practices for creating managed objects. This commit also contains formatting changes, as the code style is not consistent.
70c4cab
to
279d309
Compare
plugin/main/src/kotlinx/benchmark/gradle/JmhBytecodeGeneratorWorker.kt
Outdated
Show resolved
Hide resolved
plugin/main/src/kotlinx/benchmark/gradle/internal/BenchmarkDependencies.kt
Show resolved
Hide resolved
plugin/main/src/kotlinx/benchmark/gradle/internal/generator/workers/GenerateJsSourceWorker.kt
Show resolved
Hide resolved
plugin/main/src/kotlinx/benchmark/gradle/internal/BenchmarkDependencies.kt
Outdated
Show resolved
Hide resolved
Everything looks good to me; only need to revamp kotlinx-benchmark's CI before merging. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job!
@adam-enko please update the branch with the latest changes from |
Done! Will the PR be blocked because your last GitHub review is 'requested changes'? |
* Use Worker API to generate benchmark code - Update the Benchmark JS/Wasm/Native source generation tasks to use the Worker API, so that `kotlin-compiler-embeddable` can be a compileOnly dependency, thus resolving https://youtrack.jetbrains.com/issue/KT-66764 - Create `GenerateJsSourceWorker` and `GenerateWasmSourceWorker` for isolating the JS and Wasm generation code. - Updated the Js/Wasm/Native generation tasks to invoke the source generators in a Worker isolated classpath. - Created a new Configuration for declaring `kotlin-compiler-embeddable`, and pass it to the Js/Wasm/Native generation tasks. - Create a BenchmarkDependencies utility for defining all Configurations used in the plugin. (This also lays the groundwork for unifying the JMH version Kotlin#147 (comment)) - Updated BenchmarksPluginConstants to add `DEFAULT_KOTLIN_COMPILER_VERSION`, as sensible default for kotlin-compiler-embeddable. - Add opt-in annotation RequiresKotlinCompilerEmbeddable to highlight code that requires `kotlin-compiler-embeddable` - Some classes were updated to be `abstract`, to follow Gradle best practices for creating managed objects. This commit also contains formatting changes, as the code style is not consistent. * Replace `Kotlinx Benchmark` with `kotlinx-benchmark` in docs
Use Worker API to generate benchmark code
kotlin-compiler-embeddable
can be a compileOnly dependency, thus resolving https://youtrack.jetbrains.com/issue/KT-66764GenerateJsSourceWorker
andGenerateWasmSourceWorker
for isolating the JS and Wasm generation code.kotlin-compiler-embeddable
, and pass it to the Js/Wasm/Native generation tasks.DEFAULT_KOTLIN_COMPILER_VERSION
, as sensible default for kotlin-compiler-embeddable.kotlin-compiler-embeddable
abstract
, to follow Gradle best practices for creating managed objects.I have tested this manually by running the Gradle Plugin tests with Kotlin version set to 2.0. However, Benchmarks is not compatible with KGP 2.0 as a KGP function has changed #236. If I comment out this changed function, then Benchmarks works as expected.