kotlinx-benchmark
kotlinx-benchmark copied to clipboard
Unify and simplify source code generation
Source code generation is very similar for Native, JS, and Wasm platforms.
This and
GenerateWasmSourceWorker
are almost identical. The only exceptions areuseBenchmarkJs
param and a platform supplied toSuiteSourceGenerator
.Perhaps, we can use a single set of classes (worker and parameters) instead?
Originally posted by @fzhinkin in https://github.com/Kotlin/kotlinx-benchmark/pull/235#discussion_r1670045078
This could most likely be simplified.
If the workers were merged, then it would make sense merge all of the Native/JS/Wasm generation into a single worker and task. They don't differ significantly: Native uses KlibResolver.Native
and JS/Wasm uses KlibResolver.JS
, and this can be controlled with a Platform
input property.
It's a bit delicate to do such refactoring at the moment because the Native worker is in the public API, but will be easier once the visibility of workers is limited #211.