Skip to content

Native needs the Level configuration #280

Open
@CharlieTap

Description

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

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions