Skip to content

Provide one argument per parameter, or a single array #190

Description

@dantleech

Currently a single array is provided to benchmarking methods with a @ParamProvider:

/**
 * @ParamProviders({"provideFoo"})
 */
public function benchFoo(array $params) 
{
    $x = $param['foo'];
    $y = $param['bar'];
}

We could expand the array keys to arguments as with PHPUnit:

/**
 * @ParamProviders({"provideFoo"})
 */
public function benchFoo($foo, $bar) 
{
}

Disadvantages:

  • Slightly increased call time.
  • Multiple parameter providers give a cartesian product, it would be difficult to anticipate the argument order (although we could enforce matching keys to argument names).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions