kotlinx-benchmark icon indicating copy to clipboard operation
kotlinx-benchmark copied to clipboard

Unify and simplify source code generation

Open adam-enko opened this issue 7 months ago • 0 comments

Source code generation is very similar for Native, JS, and Wasm platforms.

This and GenerateWasmSourceWorker are almost identical. The only exceptions are useBenchmarkJs param and a platform supplied to SuiteSourceGenerator.

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.

adam-enko avatar Jul 09 '24 14:07 adam-enko