File tree Expand file tree Collapse file tree 2 files changed +18
-18
lines changed Expand file tree Collapse file tree 2 files changed +18
-18
lines changed Original file line number Diff line number Diff line change 1
1
# php-ds-array-benchmark
2
2
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.
4
4
5
5
# Usage
6
6
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
9
9
10
10
Original file line number Diff line number Diff line change 14
14
* @BeforeMethods({"init"})
15
15
* @AfterMethods({"tearDown"})
16
16
* @Iterations(5)
17
- * @Revs(10 )
17
+ * @Revs(50 )
18
18
* @OutputTimeUnit("milliseconds", precision=3)
19
19
*/
20
20
class ArrayBench
@@ -70,13 +70,13 @@ public function benchSplFixedArray()
70
70
$ i = 0 ;
71
71
foreach ($ values as $ col => $ value ) {
72
72
$ 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
80
80
],
81
81
];
82
82
}
@@ -97,13 +97,13 @@ public function benchDsVector()
97
97
$ row ["cells " ]->allocate ($ this ->colCount );
98
98
foreach ($ values as $ col => $ value ) {
99
99
$ 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
107
107
],
108
108
]);
109
109
}
You can’t perform that action at this time.
0 commit comments