Why I built the FastExcelPhp family — and who really needs it
If you have ever generated Excel files in PHP, you have almost certainly used PhpSpreadsheet. And you have almost certainly, at some point, run into one of these problems:
- a file of 200,000–300,000 rows suddenly “eats” a gigabyte of memory
- Excel generation fails inside a queue
- the script consistently slams into
memory_limit - report generation time is measured in minutes
- the Docker container dies with no explanation
At some point it becomes clear: the problem is not in the report’s code. The problem is the approach.
PhpSpreadsheet is a good tool, but not for every task
An important clarification up front: PhpSpreadsheet is an excellent library, but it has a fundamental limitation — it builds the entire object model of the workbook in memory.
Simplified, it looks like this:
$spreadsheet = new Spreadsheet();
$sheet = $spreadsheet->getActiveSheet();
foreach ($rows as $row) {
$sheet->fromArray($row);
}
Every cell is an object, every style is an object, every row is an object. Any entity — from a font to a chart, from a cell format to page settings — is an object.
At 10,000 rows this is still bearable. At 100,000 — not so much. At 500,000 — pain and misery. And at a million — a guaranteed failure.
The key idea: Excel ≠ UI, Excel = format
But why hold the whole Excel workbook in memory? After all, XLSX is a ZIP of XML files.
Which means:
- rows can be written sequentially
- styles can be reused
- there is no need to assemble the entire Excel file in memory.
The philosophy of FastExcelPhp
FastExcel is not “yet another wrapper over Excel.” It is a set of libraries built around a single idea: write and read XLSX the way it is actually structured.
Core principles:
- minimal memory consumption
- streaming writes and reads
- control over styles and XML
- no unnecessary abstractions
- predictability
The FastExcelPhp libraries do not try to emulate Excel — they work with the format directly.
What the FastExcelPhp family includes
FastExcelWriter
For generating XLSX files:
- streaming row writes
- style reuse
- any charts and diagrams supported by Excel
- formulas, conditional formatting, print settings
- writing tens and hundreds of thousands, and even millions of rows without blowing up memory
https://github.com/aVadim483/fast-excel-writer
FastExcelReader
For reading Excel:
- streaming parsing
- without loading the whole file into memory
- ideal for importing large files
https://github.com/aVadim483/fast-excel-reader
FastExcelTemplator
When Excel is a template:
- placeholders
- loops
- working with a ready-made design from analysts and accountants
https://github.com/aVadim483/fast-excel-templator
FastExcelLaravel
Integration with Laravel:
- container
- facades
- importing and exporting models and collections
- convenient configuration
https://github.com/aVadim483/fast-excel-laravel
Each library solves one set of tasks, but does it as efficiently as possible.
For whom FastExcelPhp is a must-have
The FastExcelPhp libraries are an especially good fit if you:
- build a SaaS with exports
- generate reports on a schedule
- work with marketplaces
- import large Excel files
- use queues
- are constrained on memory (Docker, serverless, shared hosting)
But if all you need is “a couple of nice little tables,” PhpSpreadsheet is still an excellent choice.