diff --git a/Makefile b/Makefile index 619df26..2ec8ba1 100644 --- a/Makefile +++ b/Makefile @@ -5,10 +5,10 @@ install-benchmarks: composer require azjezz/psl:2.0.x-dev --ignore-platform-reqs benchmarks: install-benchmarks ## run benchmarks - ./vendor/bin/phpbench run + ./vendor/bin/phpbench run --profile=local --group=others create-benchmark-reference: install-benchmarks ## run benchmarks, mark current run as "reference" - ./vendor/bin/phpbench run --tag=benchmark_reference + ./vendor/bin/phpbench run --profile=local --group=others --tag=benchmark_reference compare-benchmark-to-reference: ## run benchmarks, compare result to the "reference" run - ./vendor/bin/phpbench run --ref=benchmark_reference + ./vendor/bin/phpbench run --profile=local --group=others --ref=benchmark_reference diff --git a/tests/benchmarks/CachingIteratorsAggregateBench.php b/tests/benchmarks/CachingIteratorsAggregateBench.php index 975adf3..b80ec1f 100644 --- a/tests/benchmarks/CachingIteratorsAggregateBench.php +++ b/tests/benchmarks/CachingIteratorsAggregateBench.php @@ -17,12 +17,10 @@ use Psl\Iter\Iterator as IterIterator; use Traversable; -/** - * @Groups({"CachingIteratorsAggregateBench"}) - */ final class CachingIteratorsAggregateBench extends IteratorBenchmark { /** + * @Groups({"ci", "local"}) * @ParamProviders("provideGenerators") */ public function bench(array $params): void @@ -33,10 +31,32 @@ public function bench(array $params): void ); } + /** + * @Groups({"others"}) + * @ParamProviders("provideGeneratorsWithOthers") + */ + public function benchWithOthers(array $params): void + { + $this->doBench( + $this->getSubject($params), + $params + ); + } + public function provideGenerators(): Generator { $items = 5000; + yield 'CachingIteratorAggregate' => [ + 'class' => CachingIteratorAggregate::class, + 'size' => $items, + ]; + } + + public function provideGeneratorsWithOthers(): Generator + { + $items = 5000; + yield SimpleCachingIteratorAggregate::class => [ 'class' => SimpleCachingIteratorAggregate::class, 'size' => $items,