Skip to content
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

Fail if iterationTime or iterationTimeUnit is provided without one another in a benchmark config #125

Closed
qurbonzoda opened this issue Jul 2, 2023 · 0 comments

Comments

@qurbonzoda
Copy link
Collaborator

Currently, if iterationTime is provided without iterationTimeUnit,
in JVM the latter is assumed SECONDS, while in other platforms the fallback value specified in benchmark code is used.

benchmark {
    iterations = 5
    iterationTime = 10
    // iterationTimeUnit not specified
}

If iterationTimeUnit is provided without iterationTime, in JVM the former is ignored, while in other platforms the fallback value specified in benchmark code is used.

benchmark {
    iterations = 5
    iterationTimeUnit = ms
    // iterationTime not specified
}

kotlinx-benchmark-plugin should fail if the options are provided without one another.
Another option is to change the iterationTime type to be a class with two properties, e.g., iterationTime = IterationTime(10, "s") or iterationTime = IterationTime(10, BenchmarkTimeUnit.SECONDS)

OndrejSliva pushed a commit to OndrejSliva/kotlinx-benchmark that referenced this issue Jan 10, 2024
…dependabot/fetch-metadata-1.4.0

build(deps): bump dependabot/fetch-metadata from 1.3.6 to 1.4.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant