Skip to content

Commit 4a57826

Browse files
committed
upd
1 parent 979c0e9 commit 4a57826

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# php-ds-array-benchmark
22

3-
A playground for benchmarking php-ds vector and native array
3+
A synthetic benchmark comparison between native Array, SplFixedArray and Deque/Vector from php-ds.
44

55
# Usage
66

7-
./vendor/bin/phpbench run tests/Benchmark --file=report-default.xml --report=default
8-
./vendor/bin/phpbench run tests/Benchmark --file=report-aggregate.xml --report=aggregate
7+
./vendor/bin/phpbench run tests/Benchmark --report=default
8+
./vendor/bin/phpbench run tests/Benchmark --report=aggregate
99

1010

tests/Benchmark/ArrayBench.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* @BeforeMethods({"init"})
1515
* @AfterMethods({"tearDown"})
1616
* @Iterations(5)
17-
* @Revs(10)
17+
* @Revs(50)
1818
* @OutputTimeUnit("milliseconds", precision=3)
1919
*/
2020
class ArrayBench
@@ -70,13 +70,13 @@ public function benchSplFixedArray()
7070
$i = 0;
7171
foreach ($values as $col => $value) {
7272
$row["cells"][$i++] = [
73-
"c" => 2,
74-
"r" => 4,
75-
"c" => $col,
76-
"v" => $value,
77-
"s" => [
78-
"c" => "red",
79-
"b" => false
73+
"colspan" => 2,
74+
"rowspan" => 4,
75+
"column" => $col,
76+
"value" => $value,
77+
"styles" => [
78+
"color" => "red",
79+
"bold" => false
8080
],
8181
];
8282
}
@@ -97,13 +97,13 @@ public function benchDsVector()
9797
$row["cells"]->allocate($this->colCount);
9898
foreach ($values as $col => $value) {
9999
$row["cells"]->push([
100-
"c" => 2,
101-
"r" => 4,
102-
"c" => $col,
103-
"v" => $value,
104-
"s" => [
105-
"c" => "red",
106-
"b" => false
100+
"colspan" => 2,
101+
"rowspan" => 4,
102+
"column" => $col,
103+
"value" => $value,
104+
"styles" => [
105+
"color" => "red",
106+
"bold" => false
107107
],
108108
]);
109109
}

0 commit comments

Comments
 (0)