Skip to content

Conversation

matt-allan
Copy link

@matt-allan matt-allan commented Dec 18, 2018

Using an operator is significantly faster than calling the max function.
As this method is called more than once per cell the difference adds up.

This is:

- [x] a bugfix
- [ ] a new feature

Checklist:

Why this change is needed?

When reading a large spreadsheet the Worksheet::createNewCell method is called more times than the number of cells in the spreadsheet. When reading a ~100k cell spreadsheet I saw a 25% reduction in run time by replacing the call to max with a > comparison.

Using an operator is significantly faster than calling the max function.
As this method is called more than once per cell the difference adds up.
@PowerKiKi PowerKiKi closed this in 0f8292f Jan 2, 2019
guillaume-ro-fr pushed a commit to guillaume-ro-fr/PhpSpreadsheet that referenced this pull request Jun 12, 2019
Using an operator is significantly faster than calling the max function.
As this method is called more than once per cell the difference adds up.

Closes PHPOffice#824
BlackyTay pushed a commit to BlackyTay/PhpSpreadsheet that referenced this pull request Aug 8, 2025
Using an operator is significantly faster than calling the max function.
As this method is called more than once per cell the difference adds up.

Closes PHPOffice#824
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant