Optimize XLS (BIFF8) reader performance with reduced per-cell overhead#4833
Open
kemo wants to merge 4 commits intoPHPOffice:masterfrom
Open
Optimize XLS (BIFF8) reader performance with reduced per-cell overhead#4833kemo wants to merge 4 commits intoPHPOffice:masterfrom
kemo wants to merge 4 commits intoPHPOffice:masterfrom
Conversation
Collaborator
|
Is there a Benchmark test you can add to this PR? |
Contributor
Author
|
Sure — I'll add a benchmark test for the BIFF8 reader to this PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
updateInCollection()calls during cell reads by introducingCell::setXfIndexNoUpdate()and reordering XF index assignment beforesetValueExplicit()across all 9 cell reader methods (readRk, readLabelSst, readNumber, readFormula, readBoolErr, readLabel, readMulRk, readMulBlank, readBlank)str_split/implodefor both compressed-to-uncompressed expansion and CONTINUE record splicing$columnString . $rowIndex) in all cell reader methods instead of inline concatenationreadLabelSstand formula result type byte inreadFormulato reduce repeated lookupsChanges
src/PhpSpreadsheet/Cell/Cell.php: NewsetXfIndexNoUpdate()internal method that sets XF index without triggeringupdateInCollection()src/PhpSpreadsheet/Reader/Xls.php: All 9 cell reader methods optimized, SST string concatenation replaced, cached$phpSheetTitleand$cachedReadFilterproperties added, splice offset loops converted to indexed for-loopssrc/PhpSpreadsheet/Reader/Xls/LoadSpreadsheet.php: Sets cached read filter and sheet title at the start of each sheet iterationBenchmark results (best of 3 runs, 5 iterations each)
Test plan