From 1129cc923422aa09e4e405332e5a3b519792ab2c Mon Sep 17 00:00:00 2001 From: David Badura Date: Fri, 15 Dec 2023 15:39:13 +0100 Subject: [PATCH] add benchmark with transaction --- tests/Benchmark/SimpleSetupBench.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/Benchmark/SimpleSetupBench.php b/tests/Benchmark/SimpleSetupBench.php index 9514e3fde..914a8183b 100644 --- a/tests/Benchmark/SimpleSetupBench.php +++ b/tests/Benchmark/SimpleSetupBench.php @@ -102,4 +102,15 @@ public function benchSave10000Aggregates(): void $this->repository->save($profile); } } + + #[Bench\Revs(20)] + public function benchSave10000AggregatesTransaction(): void + { + $this->store->transactional(function (): void { + for ($i = 1; $i < 10_000; $i++) { + $profile = Profile::create(ProfileId::generate(), 'Peter'); + $this->repository->save($profile); + } + }); + } }