Skip to content

Commit

Permalink
update league csv requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
lekoala committed Jul 22, 2024
1 parent 5098a15 commit 6da073a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 22 deletions.
40 changes: 20 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,40 +103,40 @@ This package supports only 1 worksheet, as it is meant to be able to replace csv
Since we can compare our solutions, there is a built in bench.php script that give the following results on my machine
These results are run with:

openspout/openspout v4.23.1
phpoffice/phpspreadsheet 2.0.0
league/csv 9.15.0
shuchkin/simplexlsx 1.1.10
openspout/openspout 4.24.4
phpoffice/phpspreadsheet 2.1.0
league/csv 9.16.0
shuchkin/simplexlsx 1.1.11
shuchkin/simplexlsxgen 1.4.11

Reading a file with 5000 rows:

Results for csv
LeKoala\SpreadCompat\Csv\Native : 0.008
LeKoala\SpreadCompat\Csv\League : 0.0313
LeKoala\SpreadCompat\Csv\OpenSpout : 0.0971
LeKoala\SpreadCompat\Csv\PhpSpreadsheet : 0.659
LeKoala\SpreadCompat\Csv\Native : 0.0084
LeKoala\SpreadCompat\Csv\League : 0.0317
LeKoala\SpreadCompat\Csv\OpenSpout : 0.0993
LeKoala\SpreadCompat\Csv\PhpSpreadsheet : 0.6713

Results for xlsx
LeKoala\SpreadCompat\Xlsx\Native : 0.0632
LeKoala\SpreadCompat\Xlsx\Simple : 0.1433
LeKoala\SpreadCompat\Xlsx\PhpSpreadsheet : 0.7388
LeKoala\SpreadCompat\Xlsx\OpenSpout : 0.8696
LeKoala\SpreadCompat\Xlsx\Native : 0.0639
LeKoala\SpreadCompat\Xlsx\Simple : 0.1476
LeKoala\SpreadCompat\Xlsx\PhpSpreadsheet : 0.7436
LeKoala\SpreadCompat\Xlsx\OpenSpout : 0.8979


Write a file with 2500 rows:

Results for csv
LeKoala\SpreadCompat\Csv\Native : 0.0056
LeKoala\SpreadCompat\Csv\League : 0.0181
LeKoala\SpreadCompat\Csv\OpenSpout : 0.0461
LeKoala\SpreadCompat\Csv\PhpSpreadsheet : 1.8393
LeKoala\SpreadCompat\Csv\Native : 0.0065
LeKoala\SpreadCompat\Csv\League : 0.0129
LeKoala\SpreadCompat\Csv\OpenSpout : 0.0443
LeKoala\SpreadCompat\Csv\PhpSpreadsheet : 0.3668

Results for xlsx
LeKoala\SpreadCompat\Xlsx\Native : 0.0386
LeKoala\SpreadCompat\Xlsx\Simple : 0.094
LeKoala\SpreadCompat\Xlsx\OpenSpout : 0.278
LeKoala\SpreadCompat\Xlsx\PhpSpreadsheet : 0.7295
LeKoala\SpreadCompat\Xlsx\Native : 0.0401
LeKoala\SpreadCompat\Xlsx\Simple : 0.0861
LeKoala\SpreadCompat\Xlsx\OpenSpout : 0.2555
LeKoala\SpreadCompat\Xlsx\PhpSpreadsheet : 0.674

For simple imports/exports, it's very clear that using the Native adapter is the fastest.
These are not enabled by default since they might lack some compatibility feature you may require.
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"php": "^8.1"
},
"require-dev": {
"league/csv": "^9",
"league/csv": "^9.10",
"maennchen/zipstream-php": "^3.1",
"openspout/openspout": "^4",
"phpoffice/phpspreadsheet": "^1.26|^2",
Expand Down
5 changes: 4 additions & 1 deletion phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@ parameters:
level: max
paths:
- src

reportUnmatchedIgnoredErrors: true
ignoreErrors:
- "#(.*)return type has no value type specified in iterable type array#"
- "#(.*)with no value type specified in iterable type iterable#"
- "#(.*)has parameter \\$opts with no type specified.#"
- "#(.*)array_combine expects(.*)#"
- "#(.*)SpreadInterface but returns object.#"
- "#but does not specify its types: TValue#"
# https://backendtea.com/post/use-phpstan-bleeding-edge/
includes:
- vendor/phpstan/phpstan/conf/bleedingEdge.neon

0 comments on commit 6da073a

Please sign in to comment.