2025: Performance Milestone for the Symfony Ecosystem
2025: Performance Milestone for the Symfony Ecosystem#
I recently had the opportunity to present at SymfonyCon on a topic that has been driving much of my work lately: 2025: Performance Milestone for the Symfony Ecosystem.
For those who couldn’t attend, or if you want to look closer at the benchmarks and code samples, I’ve published the slides. This presentation explores how Symfony has evolved from a full-stack framework into a set of high-performance components, and how these changes are impacting API Platform.
You can view the full presentation here:
2025: Performance Milestone for the Symfony Ecosystem (Speaker Deck)
20 Years of Symfony#
We started by looking at the framework’s trajectory. Moving from the rigid full-stack structures of v1 and v2 to the flexible component system of v4+, Symfony has successfully balanced innovation with backward compatibility. This architectural shift is exactly what allows us to introduce the performance-focused components we have today.
Modern Performance Components#
A major part of the talk focused on new components designed to handle high-throughput scenarios:
- JsonStreamer: We observed amazing performance with this component. By streaming JSON rather than loading it entirely into memory, we achieved significantly lower memory usage and up to 10x faster serialization of large datasets compared to traditional methods.
- ObjectMapper (7.4/8.0): This component improves how we handle data transformation, specifically regarding nested classes, promoted read-only properties, and lazy loading.
These components are not just theoretical; they are being integrated directly into API Platform to provide these performance gains out of the box.
The Runtime: PHP & FrankenPHP#
We are celebrating 30 years of PHP, and the runtime environment has never been more exciting. I discussed the impact of FrankenPHP, particularly its worker mode. In our benchmarks, running applications in worker mode showed significant throughput gains over traditional NGINX + PHP-FPM setups.
Bridging Ecosystems: Go Extensions#
One of the more experimental but promising areas I touched on is bridging PHP with Go. The Go ecosystem offers incredible performance for specific tasks, and we can leverage that within PHP.
A prime example of this is php-go-qrcode. By offloading QR code generation to a Go extension, we saw it become faster and less memory-intensive than pure PHP implementations.
Future Optimizations#
The work is far from finished. During the talk, I highlighted ongoing efforts in the Symfony repository that promise even better results in the near future:
- Object Mapper Optimizations: We are working on a pull request that targets up to a 50% performance improvement for the mapper. See the PR: symfony/symfony#61515
- Serializer Improvements: There is also a massive optimization in the works for the Serializer component (huge thanks to Tobias Nyholm), aiming for an 87% boost. See the PR: symfony/symfony#52905
2025 is shaping up to be a pivotal year for performance in our ecosystem. If you are interested in high-performance PHP, I encourage you to check out the slides and the links above.