Long itineraries started dying with a 30-second max_execution_time fatal inside PhpSpreadsheet’s Font.php. The model wasn’t involved this time. Every style change makes PhpSpreadsheet scan the whole style collection for a match, recomputing an md5 hash for every style as it goes, so a heavily formatted workbook gets quadratic. I wrote a Spreadsheet subclass with a hash-to-style index, re-verified hits against the current hash, made misses harmless, and only used it when the plugin’s own vendored copy of the library is the one loaded. Same bytes out, 20 to 28 times faster. The timeout’s line number was a profiler with a sample size of one, and it pointed straight at the problem.
Read more "The spreadsheet that got slower the longer the trip"
