Request:
Please, create partitioning (break) by class annotation groups.
Description:
Every benchmark class can have annotation with the list of groups.
e.g.
/**
* @Groups({"group1", "group2"})
*/
class myNewBenchmark
{
..
}
Several classes can have the same group. Lets say we have 2 classes: myNewBenchmark
and myOldBenchmark
with the same group group1
. Both classes are in the same directory all_benchmarks
So we can execute the cli:
$ phpbench run --group=group1 ./all_benchmarks
An we get similar report results:
group1
+----------------+----------------+-------+
| benchmark | subject | mode |
+----------------+----------------+-------+
| myNewBenchmark | benchEvaluate1 | 457μs |
| myNewBenchmark | benchEvaluate2 | 337μs |
| myOldBenchmark | benchEvaluate1 | 349μs |
| myOldBenchmark | benchEvaluate2 | 341μs |
+----------------+----------------+-------+
At the same time there is a possibility to create reporting with partitioning by benchmarks.
e.g.
"report.generators": {
"custom": {
"extends": "expression",
"break": ["benchmark"],
"cols": {
"benchmark": null,
"subject": null,
"mode": null,
}
},
}
So we can execute cli:
$ phpbench run --report=custom ./all_benchmarks
And reporting results would give the results divided/partitioned by benchmarks:
myNewBenchmark
+----------------+----------------+-------+
| benchmark | subject | mode |
+----------------+----------------+-------+
| myNewBenchmark | benchEvaluate1 | 457μs |
| myNewBenchmark | benchEvaluate2 | 337μs |
+----------------+----------------+-------+
myOldBenchmark
+----------------+----------------+-------+
| benchmark | subject | mode |
+----------------+----------------+-------+
| myOldBenchmark | benchEvaluate1 | 457μs |
| myOldBenchmark | benchEvaluate2 | 337μs |
+----------------+----------------+-------+
Feature:
It would be nice to have partitioning/breaking by class annotation groups, similar to benchmarks breaking.
e.g.
Lets say there are several classes in all_benchmarks
directory : 3 of them have different groups and 1 of them has no group.
/**
* @Groups({"group1"})
*/
class myNewBenchmark
{
..
}
/**
* @Groups({"group1", "group-standard"})
*/
class myOldBenchmark
{
..
}
/**
* @Groups({"group-standard"})
*/
class myStandardBenchmark
{
..
}
/**
* there is no group here
*/
class myGeneralBenchmark
{
..
}
Then we create the following reporting config, where groups
contains the list of all existing groups (here: ["group1", "group-standard"]
) and iterates through them.
"report.generators": {
"custom_groups": {
"extends": "expression",
"break": ["groups"],
"cols": {
"benchmark": null,
"subject": null,
"mode": null,
}
},
}
So if we execute cli:
$ phpbench run --report=custom_groups ./all_benchmarks
we get the reporting result like:
group1
+----------------+----------------+-------+
| benchmark | subject | mode |
+----------------+----------------+-------+
| myNewBenchmark | benchEvaluate1 | 457μs |
| myNewBenchmark | benchEvaluate2 | 337μs |
| myOldBenchmark | benchEvaluate1 | 349μs |
| myOldBenchmark | benchEvaluate2 | 341μs |
+----------------+----------------+-------+
group-standard
+---------------------+----------------+-------+
| benchmark | subject | mode |
+---------------------+----------------+-------+
| myOldBenchmark | benchEvaluate1 | 349μs |
| myOldBenchmark | benchEvaluate2 | 341μs |
| myStandardBenchmark | benchEvaluate1 | 361μs |
| myStandardBenchmark | benchEvaluate2 | 350μs |
+---------------------+----------------+-------+
(no group)
+--------------------+----------------+----------+
| benchmark | subject | mode |
+--------------------+----------------+----------+
| myGeneralBenchmark | benchAssert | 1.204ms |
+--------------------+----------------+----------+
Thank you in advance!