Skip to content

Commit 9066199

Browse files
committed
fix phpbench
1 parent 48f445a commit 9066199

File tree

6 files changed

+9
-63
lines changed

6 files changed

+9
-63
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ vendor: composer.json composer.lock
3333

3434
.PHONY: benchmark
3535
benchmark:
36-
docker run -it --rm -v${CURDIR}:/opt/project -w /opt/project php:7.4-cli tools/phpbench run
36+
docker run -it --rm -v${CURDIR}:/opt/project -w /opt/project php:7.4-cli vendor/bin/phpbench run
3737

3838
.PHONY: rector
3939
rector: ## Refactor code using rector

phive.xml

Lines changed: 0 additions & 4 deletions
This file was deleted.

phpbench.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
{
2-
"bootstrap": "vendor/autoload.php",
3-
"path": "tests/benchmark"
2+
"$schema":"./vendor/phpbench/phpbench/phpbench.schema.json",
3+
"runner.bootstrap": "vendor/autoload.php",
4+
"runner.path": "tests/benchmark",
5+
"runner.file_pattern": "*Bench.php"
46
}

tests/benchmark/ContextFactoryBench.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace benchmark;
66

7+
use PhpBench\Benchmark\Metadata\Annotations\Warmup;
78
use phpDocumentor\Reflection\Types\ContextFactory;
89

910
/**
@@ -20,13 +21,6 @@ public function setup()
2021

2122
/**
2223
* @Warmup(1)
23-
* @Executor(
24-
* "blackfire",
25-
* assertions={
26-
* {"expression"="main.peak_memory < 120Mb", "title"="memory peak"},
27-
* "main.wall_time < 3S"
28-
* }
29-
* )
3024
*/
3125
public function benchCreateContextForNamespace()
3226
{

tests/benchmark/TypeResolverBench.php

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
namespace benchmark;
66

7+
use PhpBench\Benchmark\Metadata\Annotations\Revs;
8+
use PhpBench\Benchmark\Metadata\Annotations\Warmup;
79
use phpDocumentor\Reflection\TypeResolver;
810

911
/**
@@ -21,13 +23,6 @@ public function setup()
2123
/**
2224
* @Warmup(2)
2325
* @Revs(10000)
24-
* @Executor(
25-
* "blackfire",
26-
* assertions={
27-
* {"expression"="main.peak_memory < 11kb", "title"="memory peak"},
28-
* "main.wall_time < 300us"
29-
* }
30-
* )
3126
*/
3227
public function benchResolveSingleType() : void
3328
{
@@ -37,13 +32,6 @@ public function benchResolveSingleType() : void
3732
/**
3833
* @Warmup(2)
3934
* @Revs(10000)
40-
* @Executor(
41-
* "blackfire",
42-
* assertions={
43-
* {"expression"="main.peak_memory < 11kb", "title"="memory peak"},
44-
* "main.wall_time < 0.5ms"
45-
* }
46-
* )
4735
*/
4836
public function benchResolveCompoundType() : void
4937
{
@@ -53,13 +41,6 @@ public function benchResolveCompoundType() : void
5341
/**
5442
* @Warmup(2)
5543
* @Revs(10000)
56-
* @Executor(
57-
* "blackfire",
58-
* assertions={
59-
* {"expression"="main.peak_memory < 11kb", "title"="memory peak"},
60-
* "main.wall_time < 300us"
61-
* }
62-
* )
6344
*/
6445
public function benchResolveArrayType() : void
6546
{
@@ -69,13 +50,6 @@ public function benchResolveArrayType() : void
6950
/**
7051
* @Warmup(2)
7152
* @Revs(10000)
72-
* @Executor(
73-
* "blackfire",
74-
* assertions={
75-
* {"expression"="main.peak_memory < 11kb", "title"="memory peak"},
76-
* "main.wall_time < 300us"
77-
* }
78-
* )
7953
*/
8054
public function benchResolveCompoundArrayType() : void
8155
{
@@ -85,13 +59,6 @@ public function benchResolveCompoundArrayType() : void
8559
/**
8660
* @Warmup(2)
8761
* @Revs(10000)
88-
* @Executor(
89-
* "blackfire",
90-
* assertions={
91-
* {"expression"="main.peak_memory < 11kb", "title"="memory peak"},
92-
* "main.wall_time < 1ms"
93-
* }
94-
* )
9562
*/
9663
public function benchResolveCompoundArrayWithDefinedTypes() : void
9764
{

tests/benchmark/TypeResolverWithContextBench.php

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace benchmark;
66

7+
use PhpBench\Benchmark\Metadata\Annotations\Warmup;
78
use phpDocumentor\Reflection\TypeResolver;
89
use phpDocumentor\Reflection\Types\Context;
910
use phpDocumentor\Reflection\Types\ContextFactory;
@@ -32,13 +33,6 @@ public function setup()
3233

3334
/**
3435
* @Warmup(2)
35-
* @Executor(
36-
* "blackfire",
37-
* assertions={
38-
* {"expression"="main.peak_memory < 11kb", "title"="memory peak"},
39-
* "main.wall_time < 1ms"
40-
* }
41-
* )
4236
*/
4337
public function benchResolveCompoundArrayWithDefinedTypes() : void
4438
{
@@ -47,13 +41,6 @@ public function benchResolveCompoundArrayWithDefinedTypes() : void
4741

4842
/**
4943
* @Warmup(2)
50-
* @Executor(
51-
* "blackfire",
52-
* assertions={
53-
* {"expression"="main.peak_memory < 11kb", "title"="memory peak"},
54-
* "main.wall_time < 1ms"
55-
* }
56-
* )
5744
*/
5845
public function benchArrayOfClass() : void
5946
{

0 commit comments

Comments
 (0)