Skip to content

Commit 033f317

Browse files
committed
Fix BSONMicroBench::benchDecoding to take the already encoded bson-binary
1 parent 58c96ba commit 033f317

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

benchmark/src/DriverBench/BSONMicroBench.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
*/
1717
final class BSONMicroBench
1818
{
19+
/** @param array{document:Document} $params */
1920
#[ParamProviders('provideParams')]
2021
public function benchEncoding(array $params): void
2122
{
@@ -25,12 +26,13 @@ public function benchEncoding(array $params): void
2526
}
2627
}
2728

29+
/** @param array{bson:string} $params */
2830
#[ParamProviders('provideParams')]
2931
public function benchDecoding(array $params): void
3032
{
31-
$document = $params['document'];
33+
$bson = $params['bson'];
3234
for ($i = 0; $i < 10_000; $i++) {
33-
Document::fromBSON($document);
35+
Document::fromBSON($bson);
3436
}
3537
}
3638

0 commit comments

Comments
 (0)