Skip to content

Commit a78671e

Browse files
committed
Upgrade benchmarks (again)
1 parent a53b636 commit a78671e

8 files changed

+72
-19
lines changed

bench/composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
},
2727
"scripts": {
2828
"bench": [
29-
"phpbench run --report=grouped --tag=current --filter=benchNormalization",
30-
"phpbench run --report=grouped --tag=current --filter=benchCachedNormalization",
31-
"phpbench run --report=grouped --tag=current --filter=benchDenormalization",
32-
"phpbench run --report=grouped --tag=current --filter=benchCachedDenormalization"
29+
"phpbench run --report=default --tag=current --progress=none --filter=benchNormalization",
30+
"phpbench run --report=default --tag=current --progress=none --filter=benchCachedNormalization",
31+
"phpbench run --report=default --tag=current --progress=none --filter=benchDenormalization",
32+
"phpbench run --report=default --tag=current --progress=none --filter=benchCachedDenormalization"
3333
]
3434
},
3535
"minimum-stability": "dev",

bench/phpbench.json

Lines changed: 62 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema":"./vendor/phpbench/phpbench/phpbench.schema.json",
2+
"$schema": "./vendor/phpbench/phpbench/phpbench.schema.json",
33
"runner.bootstrap": "vendor/autoload.php",
44
"runner.path": "src",
55
"runner.progress": "plain",
@@ -15,9 +15,68 @@
1515
"storage.store_binary": true,
1616
"storage.driver": "xml",
1717
"report.generators": {
18-
"grouped": {
18+
"default": {
1919
"extends": "overview",
20-
"tabbed": false
20+
"tabbed": false,
21+
"components": [
22+
{
23+
"component": "section",
24+
"tabbed": true,
25+
"tab_labels": [
26+
"Time",
27+
"Memory"
28+
],
29+
"components": [
30+
{
31+
"title": "Average iteration times aggregated by benchmark",
32+
"component": "bar_chart_aggregate",
33+
"x_partition": [
34+
"benchmark_name"
35+
],
36+
"bar_partition": [
37+
"suite_tag"
38+
],
39+
"y_expr": "mode(partition['result_time_avg'])",
40+
"y_axes_label": "yValue as time precision 1"
41+
},
42+
{
43+
"title": "Average peak memory aggregated by benchmark",
44+
"component": "bar_chart_aggregate",
45+
"x_partition": [
46+
"benchmark_name"
47+
],
48+
"bar_partition": [
49+
"suite_tag"
50+
],
51+
"y_expr": "mode(partition['result_mem_peak'])",
52+
"y_axes_label": "yValue as memory precision 1"
53+
},
54+
{
55+
"component": "section",
56+
"title": "Results",
57+
"components": [
58+
{
59+
"component": "table_aggregate",
60+
"title": "{{ first(frame.suite_tag) }}",
61+
"partition": [
62+
"benchmark_name",
63+
"subject_name",
64+
"variant_name"
65+
],
66+
"row": {
67+
"benchmark": "first(partition['benchmark_name'])",
68+
"memory": "first(partition['result_mem_peak']) as memory",
69+
"min": "min(partition['result_time_avg']) as time",
70+
"max": "max(partition['result_time_avg']) as time",
71+
"mode": "mode(partition['result_time_avg']) as time",
72+
"rstdev": "rstdev(partition['result_time_avg'])"
73+
}
74+
}
75+
]
76+
}
77+
]
78+
}
79+
]
2180
}
2281
}
2382
}

bench/src/JMSAttributesBench.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,12 @@
88
use JMS\Serializer\SerializerBuilder;
99
use Metadata\Cache\PsrCacheAdapter;
1010
use PhpBench\Attributes\BeforeMethods;
11-
use PhpBench\Attributes\Groups;
1211
use PhpBench\Attributes\Iterations;
1312
use PhpBench\Attributes\Revs;
1413
use PhpBench\Attributes\Warmup;
1514
use TypeLang\Mapper\Bench\Stub\ExampleRequestDTO;
1615

17-
#[Revs(10), Warmup(5), Iterations(10), BeforeMethods('prepare')]
16+
#[Revs(20), Warmup(5), Iterations(20), BeforeMethods('prepare')]
1817
final class JMSAttributesBench extends MapperBenchmark
1918
{
2019
private readonly Serializer $raw;

bench/src/SymfonyDocBlockBench.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
namespace TypeLang\Mapper\Bench;
66

77
use PhpBench\Attributes\BeforeMethods;
8-
use PhpBench\Attributes\Groups;
98
use PhpBench\Attributes\Iterations;
109
use PhpBench\Attributes\Revs;
1110
use PhpBench\Attributes\Warmup;
@@ -18,7 +17,7 @@
1817
use Symfony\Component\Serializer\Serializer;
1918
use TypeLang\Mapper\Bench\Stub\ExampleRequestDTO;
2019

21-
#[Revs(10), Warmup(5), Iterations(10), BeforeMethods('prepare')]
20+
#[Revs(20), Warmup(5), Iterations(20), BeforeMethods('prepare')]
2221
final class SymfonyDocBlockBench extends MapperBenchmark
2322
{
2423
private readonly Serializer $raw;

bench/src/SymfonyPHPStanBench.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
namespace TypeLang\Mapper\Bench;
66

77
use PhpBench\Attributes\BeforeMethods;
8-
use PhpBench\Attributes\Groups;
98
use PhpBench\Attributes\Iterations;
109
use PhpBench\Attributes\Revs;
1110
use PhpBench\Attributes\Warmup;
@@ -18,7 +17,7 @@
1817
use Symfony\Component\Serializer\Serializer;
1918
use TypeLang\Mapper\Bench\Stub\ExampleRequestDTO;
2019

21-
#[Revs(10), Warmup(5), Iterations(10), BeforeMethods('prepare')]
20+
#[Revs(20), Warmup(5), Iterations(20), BeforeMethods('prepare')]
2221
final class SymfonyPHPStanBench extends MapperBenchmark
2322
{
2423
private readonly Serializer $raw;

bench/src/TypeLangAttributesBench.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
namespace TypeLang\Mapper\Bench;
66

77
use PhpBench\Attributes\BeforeMethods;
8-
use PhpBench\Attributes\Groups;
98
use PhpBench\Attributes\Iterations;
109
use PhpBench\Attributes\Revs;
1110
use PhpBench\Attributes\Warmup;
@@ -16,7 +15,7 @@
1615
use TypeLang\Mapper\Mapping\Driver\ReflectionDriver;
1716
use TypeLang\Mapper\Platform\StandardPlatform;
1817

19-
#[Revs(10), Warmup(5), Iterations(10), BeforeMethods('prepare')]
18+
#[Revs(20), Warmup(5), Iterations(20), BeforeMethods('prepare')]
2019
final class TypeLangAttributesBench extends MapperBenchmark
2120
{
2221
private readonly Mapper $raw;

bench/src/TypeLangDocBlockBench.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
namespace TypeLang\Mapper\Bench;
66

77
use PhpBench\Attributes\BeforeMethods;
8-
use PhpBench\Attributes\Groups;
98
use PhpBench\Attributes\Iterations;
109
use PhpBench\Attributes\Revs;
1110
use PhpBench\Attributes\Warmup;
@@ -16,7 +15,7 @@
1615
use TypeLang\Mapper\Mapping\Driver\ReflectionDriver;
1716
use TypeLang\Mapper\Platform\StandardPlatform;
1817

19-
#[Revs(10), Warmup(5), Iterations(10), BeforeMethods('prepare')]
18+
#[Revs(20), Warmup(5), Iterations(20), BeforeMethods('prepare')]
2019
final class TypeLangDocBlockBench extends MapperBenchmark
2120
{
2221
private readonly Mapper $raw;

bench/src/ValinorBench.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,12 @@
1010
use CuyZ\Valinor\Normalizer\Format;
1111
use CuyZ\Valinor\Normalizer\Normalizer;
1212
use PhpBench\Attributes\BeforeMethods;
13-
use PhpBench\Attributes\Groups;
1413
use PhpBench\Attributes\Iterations;
1514
use PhpBench\Attributes\Revs;
1615
use PhpBench\Attributes\Warmup;
1716
use TypeLang\Mapper\Bench\Stub\ExampleRequestDTO;
1817

19-
#[Revs(10), Warmup(5), Iterations(10), BeforeMethods('prepare')]
18+
#[Revs(20), Warmup(5), Iterations(20), BeforeMethods('prepare')]
2019
final class ValinorBench extends MapperBenchmark
2120
{
2221
private readonly TreeMapper $rawMapper;

0 commit comments

Comments
 (0)