Skip to content

slow execution introduced in pull request #4073  #4157

@cristicotet

Description

@cristicotet

This is:

- [X] a bug report
- [ ] a feature request
- [ ] **not** a usage question (ask them on https://stackoverflow.com/questions/tagged/phpspreadsheet or https://gitter.im/PHPOffice/PhpSpreadsheet)

What is the expected behavior?

fast execution :)

What is the current behavior?

Very slow performance introduced in commit:
Merge pull request #4073 from oleibman/issue1310

The problem is caused by calling the following code in setValueExplicit

$this->getWorksheet()->applyStylesFromArray($cellCoordinate, ['quotePrefix' => $quotePrefix]);

For my particular script (14 sheets), without that line: 2.5-2.6 seconds, with that line: 7.0-7.2 seconds (almost 3x)

What are the steps to reproduce?

Write a bigger XLSX file. Versions before that commit execute way faster.
Commenting the line will reverse performance regression.
Maybe line should not be called on every call to setValueExplicit ?

Which versions of PhpSpreadsheet and PHP are affected?

All since 2.2.0.
Version 2.1.0 is not affecected
PHP 8.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions