polyfractal/athletic — pull request #31 by dantleech (2014-10-18 20:54:09+00:00)
Title: [POC} Added iterations and dataprovider

This is a quick and dirty PR that:

- implements data providers
- allows multiple iteration speciications
- forces to prefix the method with `perform`.

If it is interesting I could break it up into separate PRs and write it properly...

For example:

````php
public function provideFullTreeTraversal()
{
return array(
array(10, 100),
array(20, 200),
);
}

/**
* @dataProvider provideFullTreeTraversal
* @iterations 1
* @iterations 10
*/
public function performFullTreeTraversal($from, $to)
{
$rootNode = $this->getSession()->getRootNode();
$this->iterateNode($rootNode);
}
````

Produces:

````
PHPCR\Benchmark\Suites\Reading\TraversalEvent
Method Name Iterations Average Time Ops/second
--------------------------------- ------------ ---------------- -------------
FullTreeTraversal(from=10,to=100): [1 ] [0.0515341758728] [19.40460]
FullTreeTraversal(from=10,to=100): [10 ] [0.0038705348969] [258.36222]
FullTreeTraversal(from=20,to=200): [1 ] [0.0037219524384] [268.67619]
FullTreeTraversal(from=20,to=200): [10 ] [0.0038553476334] [259.37998]
````