From 7f184fb6a900452ebc4331b3c1e03e062a808ba1 Mon Sep 17 00:00:00 2001 From: "A. B. M. Mahmudul Hasan" Date: Mon, 10 Aug 2026 21:20:47 +0600 Subject: [PATCH] updated bench --- benchmarks/ArraySingleBench.php | 10 +++++----- benchmarks/MembershipCrossoverBench.php | 4 +++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/benchmarks/ArraySingleBench.php b/benchmarks/ArraySingleBench.php index dd17467..e7199f6 100644 --- a/benchmarks/ArraySingleBench.php +++ b/benchmarks/ArraySingleBench.php @@ -66,11 +66,6 @@ public function benchDiff(): void ArraySingle::diff($this->data, $this->needles, true); } - public function benchDuplicates(): void - { - ArraySingle::duplicates($this->data); - } - public function benchIntersect(): void { ArraySingle::intersect($this->data, $this->needles, true); @@ -124,6 +119,11 @@ public function benchSeededShuffle(): void ArraySingle::shuffle($this->data, 12345); } + public function benchStrictDuplicates(): void + { + ArraySingle::duplicates($this->data, true); + } + public function benchSum(): void { ArraySingle::sum($this->data); diff --git a/benchmarks/MembershipCrossoverBench.php b/benchmarks/MembershipCrossoverBench.php index b2719e3..ccf39b5 100644 --- a/benchmarks/MembershipCrossoverBench.php +++ b/benchmarks/MembershipCrossoverBench.php @@ -9,10 +9,12 @@ use PhpBench\Attributes\BeforeMethods; use PhpBench\Attributes\Iterations; use PhpBench\Attributes\ParamProviders; +use PhpBench\Attributes\RetryThreshold; use PhpBench\Attributes\Revs; #[Revs(3)] #[Iterations(5)] +#[RetryThreshold(100)] #[BeforeMethods('setUp')] #[ParamProviders('provideMembershipWorkloads')] final class MembershipCrossoverBench @@ -125,7 +127,7 @@ public function provideMembershipWorkloads(): array { $workloads = []; - foreach ([1, 2, 8, 16, 32, 64, 128, 192, 256, 512] as $size) { + foreach ([128, 192, 256, 512] as $size) { foreach (['hit-first', 'hit-last', 'miss'] as $distribution) { $workloads[$size . '-' . $distribution] = [ 'size' => $size,