Add benchmark for merging cells

This commit is contained in:
MarkBaker
2022-11-20 10:51:11 +01:00
parent 3beb0a4652
commit 12e6d0ffe1
7 changed files with 479 additions and 146 deletions
+6 -6
View File
@@ -82,15 +82,15 @@
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "dev-master",
"dompdf/dompdf": "^1.0 || ^2.0",
"friendsofphp/php-cs-fixer": "^3.2",
"dompdf/dompdf": "^2.0",
"friendsofphp/php-cs-fixer": "^3.13",
"mitoteam/jpgraph": "^10.2.4",
"mpdf/mpdf": "^8.1.1",
"mpdf/mpdf": "^8.1.2",
"phpbench/phpbench": "^1.2",
"phpcompatibility/php-compatibility": "^9.3",
"phpstan/phpstan": "^1.1",
"phpstan/phpstan-phpunit": "^1.0",
"phpunit/phpunit": "^8.5 || ^9.0",
"phpstan/phpstan": "^1.9",
"phpstan/phpstan-phpunit": "^1.2",
"phpunit/phpunit": "^9.0",
"squizlabs/php_codesniffer": "^3.7",
"tecnickcom/tcpdf": "^6.5"
},
Generated
+435 -130
View File
File diff suppressed because it is too large Load Diff
@@ -12,7 +12,7 @@ class InsertColumnBenchmark extends AbstractInsertDelete
/**
* @Groups({"slow"})
* @revs(4)
* @Iterations(5)
* @Iterations(4)
* @OutputTimeUnit("milliseconds")
* @AfterMethods("tearDown")
*/
@@ -24,7 +24,7 @@ class InsertColumnBenchmark extends AbstractInsertDelete
/**
* @Groups({"slow"})
* @revs(4)
* @Iterations(5)
* @Iterations(4)
* @OutputTimeUnit("milliseconds")
* @AfterMethods("tearDown")
*/
@@ -12,7 +12,7 @@ class InsertRowBenchmark extends AbstractInsertDelete
/**
* @Groups({"slow"})
* @revs(4)
* @Iterations(5)
* @Iterations(4)
* @OutputTimeUnit("milliseconds")
* @AfterMethods("tearDown")
*/
@@ -24,7 +24,7 @@ class InsertRowBenchmark extends AbstractInsertDelete
/**
* @Groups({"slow"})
* @revs(4)
* @Iterations(7)
* @Iterations(4)
* @OutputTimeUnit("milliseconds")
* @AfterMethods("tearDown")
*/
@@ -36,7 +36,7 @@ class InsertRowBenchmark extends AbstractInsertDelete
/**
* @Groups({"slow"})
* @revs(4)
* @Iterations(11)
* @Iterations(7)
* @OutputTimeUnit("milliseconds")
* @AfterMethods("tearDown")
*/
@@ -12,7 +12,7 @@ class RemoveColumnBenchmark extends AbstractInsertDelete
/**
* @Groups({"slow"})
* @revs(4)
* @Iterations(5)
* @Iterations(4)
* @OutputTimeUnit("milliseconds")
* @AfterMethods("tearDown")
*/
@@ -24,7 +24,7 @@ class RemoveColumnBenchmark extends AbstractInsertDelete
/**
* @Groups({"slow"})
* @revs(4)
* @Iterations(5)
* @Iterations(4)
* @OutputTimeUnit("milliseconds")
* @AfterMethods("tearDown")
*/
@@ -12,7 +12,7 @@ class RemoveRowBenchmark extends AbstractInsertDelete
/**
* @Groups({"slow"})
* @revs(4)
* @Iterations(5)
* @Iterations(4)
* @OutputTimeUnit("milliseconds")
* @AfterMethods("tearDown")
*/
@@ -24,7 +24,7 @@ class RemoveRowBenchmark extends AbstractInsertDelete
/**
* @Groups({"slow"})
* @revs(4)
* @Iterations(7)
* @Iterations(4)
* @OutputTimeUnit("milliseconds")
* @AfterMethods("tearDown")
*/
@@ -36,7 +36,7 @@ class RemoveRowBenchmark extends AbstractInsertDelete
/**
* @Groups({"slow"})
* @revs(4)
* @Iterations(11)
* @Iterations(7)
* @OutputTimeUnit("milliseconds")
* @AfterMethods("tearDown")
*/
@@ -0,0 +1,28 @@
<?php
namespace PhpOffice\PhpSpreadsheetPerformance\Worksheet;
use PhpOffice\PhpSpreadsheetPerformance\ReferenceHelper\AbstractInsertDelete;
class MergeCellsBenchmark extends AbstractInsertDelete
{
public function __construct()
{
parent::__construct(256, 512);
}
/**
* @revs(5)
* @Iterations(12)
* @OutputTimeUnit("milliseconds")
* @AfterMethods("tearDown")
*/
public function benchmarkMergeCellsByArray(): void
{
for ($row = 1; $row <= 512; $row += 4) {
for ($column = 1; $column <= 256; $column += 4) {
$this->spreadsheet->getActiveSheet()->mergeCells([$column, $row, $column + 2, $row + 2]);
}
}
}
}