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

Native needs the Level configuration #280

Open
CharlieTap opened this issue Nov 28, 2024 · 0 comments
Open

Native needs the Level configuration #280

CharlieTap opened this issue Nov 28, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@CharlieTap
Copy link

Without being able to specify level iteration, tests are really clunky to configure. For example say I have a class:

class Benchmark {

    val stack = stack()

    @Setup
    fun setup() {
        stack.push(1)
    }
 
    @Teardown
    fun cleanup() {
         stack.clear()
    }


    @Benchmark
    fun benchmark() {
        stack.pop()
    }
}

This will not work because setup is only ran once. I could push a 1000 elements during setup and just hope the iterations exceed the amount of pops in the test, but this would also mean stack has an unrealistically large dataset and skew my measurement. I could put the setup code in the actual benchmark itself, but then I wouldn't be measuring exactly what I want. Level is a really important important config in JMH and without it native tests seem too awkward to be worth configuring

@fzhinkin fzhinkin added the enhancement New feature or request label Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants