This repository has been archived by the owner on Jan 2, 2019. It is now read-only.
Inline xfIndexes search in PHPExcel_Style::applyFromArray() #103
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.
Calculate hashes of styles for _cellXfCollection only once.
Use of cellXfExists() in applyFromArray() is bad idea. Every cloned new style in applyFromArray() is new object and will always be added to styles collection.
[Examples][cellXfExists]$ php 41applyFromArray.php
...
20:02:22 applyFromArray styles (begin)
20:02:22 _cellXfCollection count before: 1
20:02:22 _cellXfCollection count after size styles: 101
20:02:23 _cellXfCollection count after new style: 1101
20:02:23 applyFromArray styles (end), time: 0.42 s
20:02:23 Write to Excel2007 format
20:02:23 File written to 41applyFromArray.xlsx
20:02:23 Peak memory usage: 13.75 MB
...
[Examples][getCellXfByHashCode]$ php 41applyFromArray.php
...
20:02:37 applyFromArray styles (begin)
20:02:37 _cellXfCollection count before: 1
20:02:37 _cellXfCollection count after size styles: 10
20:02:37 _cellXfCollection count after new style: 11
20:02:37 applyFromArray styles (end), time: 0.19 s
20:02:37 Write to Excel2007 format
20:02:38 File written to 41applyFromArray.xlsx
20:02:38 Peak memory usage: 3.25 MB
...
[Examples][inline-search]$ php 41applyFromArray.php
...
20:03:02 applyFromArray styles (begin)
20:03:02 _cellXfCollection count before: 1
20:03:03 _cellXfCollection count after size styles: 10
20:03:03 _cellXfCollection count after new style: 11
20:03:03 applyFromArray styles (end), time: 0.14 s
20:03:03 Write to Excel2007 format
20:03:03 File written to 41applyFromArray.xlsx
20:03:03 Peak memory usage: 3.25 MB
...