File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121 php-version : ' 8.0'
2222 tools : cs2pr, phpcs
2323 - name : Run phpcs
24- run : phpcs -q --report=checkstyle src/*.php tests/*.php | cs2pr
24+ run : phpcs -q --report=checkstyle src/ tests/ | cs2pr
2525
26+ benchmark :
27+ runs-on : ubuntu-20.04
28+ strategy :
29+ matrix :
30+ php-versions : ['7.4', '8.0', '8.1']
31+ steps :
32+ - uses : actions/checkout@v2.4.0
33+ - name : Setup PHP
34+ uses : shivammathur/setup-php@2.15.0
35+ with :
36+ php-version : ${{ matrix.php-versions }}
37+ tools : composer, phpbench/phpbench
38+ coverage : none
39+ ini-values : memory_limit=-1
40+ - name : Install dependencies
41+ run : composer install
42+ - name : PHPBench
43+ run : phpbench run -q --report=aggregate --
44+
45+
2646 unit-tests :
2747 runs-on : ubuntu-20.04
2848 strategy :
Original file line number Diff line number Diff line change 1+ {
2+ "runner.bootstrap" : " vendor/autoload.php" ,
3+ "runner.path" : " tests/Benchmark" ,
4+ "runner.iterations" : 5 ,
5+ "runner.revs" : 1000
6+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace UUID \Benchmark ;
6+
7+ use UUID \UUID ;
8+
9+ class UUIDGenerationBench
10+ {
11+ public function benchUUID3Generation (): void
12+ {
13+ UUID ::uuid3 (UUID ::NAMESPACE_DNS , 'php.net ' );
14+ }
15+
16+ public function benchUUID4Generation (): void
17+ {
18+ UUID ::uuid4 ();
19+ }
20+
21+ public function benchUUID5Generation (): void
22+ {
23+ UUID ::uuid5 (UUID ::NAMESPACE_DNS , 'php.net ' );
24+ }
25+
26+ public function benchUUID6Generation (): void
27+ {
28+ UUID ::uuid6 ();
29+ }
30+ }
You can’t perform that action at this time.
0 commit comments