forked from nikic/FastRoute
-
Notifications
You must be signed in to change notification settings - Fork 0
/
RouteRegistrationBench.php
41 lines (35 loc) · 972 Bytes
/
RouteRegistrationBench.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
declare(strict_types=1);
namespace FastRoute\Benchmark;
use FastRoute\Dispatcher;
use PhpBench\Attributes as Bench;
#[Bench\Iterations(5)]
#[Bench\Revs(100)]
#[Bench\Warmup(3)]
final class RouteRegistrationBench
{
#[Bench\Subject]
#[Bench\Groups(['group_count'])]
public function groupCount(): void
{
DispatcherForBenchmark::realLifeExample(Dispatcher\GroupCountBased::class);
}
#[Bench\Subject]
#[Bench\Groups(['char_count'])]
public function charCount(): void
{
DispatcherForBenchmark::realLifeExample(Dispatcher\CharCountBased::class);
}
#[Bench\Subject]
#[Bench\Groups(['group_pos'])]
public function groupPos(): void
{
DispatcherForBenchmark::realLifeExample(Dispatcher\GroupPosBased::class);
}
#[Bench\Subject]
#[Bench\Groups(['mark'])]
public function mark(): void
{
DispatcherForBenchmark::realLifeExample(Dispatcher\MarkBased::class);
}
}