AI Summary
This video is a recap of PHP performance-related talks and topics from SymfonyCon 2025 in Amsterdam, which also celebrated 20 years of Symfony. The speaker shares insights from five key talks covering topics like PHP code generation, the JSON streamer component, FrankenPHP, ClickHouse, and using Rust with PHP via FFI. The video concludes with personal reflections and thanks to the Symfony team.
Chapters
The speaker introduces the video as a recap of PHP performance topics from SymfonyCon in Amsterdam, noting it's the last video of the year. They mention the conference celebrated 20 years of Symfony and was held in a large venue in the city center with 1,200 attendees.
Fabien's keynote connected the history of Symfony, released Symfony 8.0 on stage, and discussed Symfony's future with AI. The speaker highlights it as a great keynote showing Symfony's progress and performance direction.
Antoine's talk covered PHP code generation optimization, the new JSON streamer component in Symfony 7.3, and FrankenPHP's integration. The JSON streamer allows streaming large JSON structures, reducing memory and increasing throughput (2.7 MB/s vs 1 MB/s for serialize).
FrankenPHP is now part of the PHP Foundation. The speaker compares FrankenPHP classic mode (similar to PHP-FPM) with worker mode (reuses state across requests, faster). They reference benchmarks and a discussion on improving classic mode's tail latency.
Paul's talk (not attended but referenced) provides a demo application for scaling PHP, covering FPM and FrankenPHP configurations, PHP INI settings, and exporting opcache metrics in Prometheus format via a Symfony controller.
ClickHouse is an efficient columnar time-series database. The speaker discusses its benefits for storing performance/log data, but notes their current use of Elasticsearch with pre-aggregation. Roman's demo showed a simple Blackfire clone using ClickHouse and Symfony, with batch inserts via message queues.
Mitchell's talk demonstrated replacing PHP code with Rust via FFI. The speaker notes FFI is not enabled by default in web contexts and has security implications, but ext-rust is an alternative for building PHP extensions in Rust.
The speaker's talk summarized native lazy objects in PHP 8.4, their integration into Doctrine and Symfony, and how they replace code-generated proxies since 2010. Slides and videos are available.
The speaker thanks the Symfony team for a well-organized conference and the 20-year celebration party. They wish viewers happy holidays and encourage subscribing for future content.
SymfonyCon 2025 showcased significant PHP performance advancements, including JSON streaming, FrankenPHP's evolution, and native lazy objects. The conference highlighted the community's ongoing efforts to optimize PHP applications for speed and scalability.
Mentioned in this Video
Symfony 2025 talks repository (by MyKiwi)
link
Dragoonis Symfony 2025 scaling repository
link
FrankenPHP vs PHP-FPM video
link
FrankenPHP project discussion
link
Antoine BL
person
Paul Dragoonis
person
Roman (Blackfire team)
person
Mitchell Verger
person
ClickHouse
tool
FrankenPHP
tool
JSON streamer component
tool
ext-rust
tool
Study Flashcards (7)
What is the JSON streamer component in Symfony 7.3?
medium
Click to reveal answer
What is the JSON streamer component in Symfony 7.3?
It allows streaming large JSON structures, reducing memory usage and increasing throughput compared to json_encode.
05:45
What is the difference between FrankenPHP classic mode and worker mode?
medium
Click to reveal answer
What is the difference between FrankenPHP classic mode and worker mode?
Classic mode follows the shared-nothing principle like PHP-FPM, while worker mode reuses state across requests, reducing bootstrap overhead and latency.
07:07
What is the main advantage of using ClickHouse for time-series data?
easy
Click to reveal answer
What is the main advantage of using ClickHouse for time-series data?
It stores data in a columnar format, making it efficient for time-series data aggregation and analysis.
12:54
What is the recommended batch size for inserting data into ClickHouse?
easy
Click to reveal answer
What is the recommended batch size for inserting data into ClickHouse?
Around 1,000 rows per batch.
15:23
What is the main caveat of using FFI in PHP for web applications?
medium
Click to reveal answer
What is the main caveat of using FFI in PHP for web applications?
FFI is not enabled by default in web contexts and has security implications.
18:32
What is the alternative to FFI for building PHP extensions in Rust?
medium
Click to reveal answer
What is the alternative to FFI for building PHP extensions in Rust?
ext-rust.
18:17
What is the significance of native lazy objects in PHP 8.4?
hard
Click to reveal answer
What is the significance of native lazy objects in PHP 8.4?
They replace code-generated proxies for lazy loading, improving performance and reducing complexity.
19:02
💡 Key Takeaways
JSON Streamer Performance
Shows a concrete performance improvement (2.7 MB/s vs 1 MB/s) and memory reduction, making it a valuable optimization for large JSON responses.
05:45FrankenPHP Joins PHP Foundation
This is a major ecosystem event that could increase adoption and development of FrankenPHP.
06:53ClickHouse for Time-Series
Highlights a growing trend of using columnar databases for performance monitoring, which is relevant for many developers.
12:54Native Lazy Objects
This is a significant PHP 8.4 feature that simplifies lazy loading and could become a standard practice.
19:02Full Transcript
[00:03] everything PHP performance related that I saw and discussed during Symfony in Amsterdam which was a few weeks ago. This is also going to be the last video of this year and we will pick up in January with more topics about PHP
[00:16] performance. We recently had our team event here in Bon and planned the next few months of content ahead. It's really going to be great. Symphony Con in Amsterdam is also a celebration of 20 years of symphony and that's an amazing
[00:31] accomplishment. I want to start with a few impressions of the location because the location is really amazing in Amsterdam. It's like right in the city center next to the train station. It has this huge halls which can fill like over
[00:46] thousand people and the conference had 1,200 people and uh also this super big exposition hall where uh there was all the vendors and the food. So um I really
[01:00] like this location. It's like really bombastic. So for 20 years of symphony uh there was no new elephant. I only have this 15 years uh elephant. Um uh but there was this really amazing comic book about the history of symphony. It's
[01:16] called two decades of symphony built to last and it has the story of symphony uh happened. I really loved going through it um and seeing everything that also I
[01:30] was connected to the initial Symfony 2 works and stuff. Uh remembering how everything worked and uh and everything sort of uh came to place. There was some time to get other elephants. So I got this Franken PHP elephant here. That's a
[01:45] this Franken PHP elephant here. That's a really cool one. Um and also uh I got a PHP Storm elephant. Uh thank you to Roman and Brandt who gifted it to me. And uh if you have been a close watcher of the latest videos, you also know that
[02:01] there's going to be a tightest elephant. So we have this uh small titress elephant which arrived here in Germany a few weeks ago. And there's also a big uh few weeks ago. And there's also a big uh brother or sister if you want.
[02:22] anniversary of Symphony uh next year Tideways has its 10year anniversary and this is where we are going to send out these elephants to uh customers, partners and friends alike. So uh stay tuned for elephants. Let's start with
[02:37] the conference and uh the talks that I watched. So there was uh the keynote from Fabian about 20 years of symphony where he sort of connected all the dots where he sort of connected all the dots and also released Symfony 8.0 on stage
[02:51] and sort of showed his process and like how everything sort of folded together. He also talked about symfony and AI and some ideas about like how this might come together. And uh overall I think like it was a great keynote which showed
[03:07] sort of like the progress of Symfony and where it's heading from a performance uh perspective. I want to talk about uh four talks uh or
[03:20] five let's see five talks and uh I will yeah give you like a slight overview or point you to different resources on those talks um to give you an idea about what I learned about PHP performance or what what PHP
[03:36] performance topics we saw at the conference. So the first talk is 2025 performance milestone for the Symphfony ecosystem from Antoan Bl. He um works on
[03:49] ecosystem from Antoan Bl. He um works on the uh API platform team and um also I believe on the Symfony team. So he uh has a lot of knowledge about these two and this talk was also about Franken PHP and um these integrations.
[04:05] and um these integrations. So I found a Reddit post uh from uh my Kiwi that uh who collected all the different talks and links uh to slides different talks and links uh to slides and stuff. So um you can find his GitHub
[04:20] and stuff. So um you can find his GitHub repository like Symfony 2025 talks and um there is this talk here. It also has the slides of Antoan's talk. I want to go through it like uh very quickly and just so show some stuff. So one
[04:36] thing that he uh brought to mind was like the PHP dumping optimization. This is going to be something I want to talk about next year as well. So PHP has talk about next year as well. So PHP has this uh pattern uh where uh parts of the
[04:51] application generate other PHP code that is then efficiently stored in opcache and executed. uh that can either be PHP code generating PHP other PHP code or
[05:03] code generating PHP other PHP code or sort of configuration uh being uh sort of translated into PHP code and Symfony uses this pattern quite extensively uh and uh Antoine was showing this or sort of like reminding everyone that like
[05:18] dependency injection config routting twick expression language translation and cache are using this pattern and it's a great pattern to make PHP applications faster and Symfony really has mastered it by compiling the
[05:31] dependency injection container and uh this is something I want to take up next this is something I want to take up next year and talk about um and show you. He also talked about the JSON streamer component which is new in Symphfony 7.3.
[05:45] It allows you to stream uh JSON. So large object structures can be streamed to JSON which makes it much faster than serializing it using the JSON encode function. It requires uh uh less memory and um is
[06:03] also faster. So he has this benchmark showing that serialize uh sort of like has one megabyte of throughput and uh and the JSON streamer throughput and uh and the JSON streamer has 2.2 two or no 2.7 megabytes. So 2.7
[06:19] uh megabytes more of throughput. Also the time to first bite obviously is much quicker because you can start sending out the first part of the JSON document uh and then stream the rest. Uh he showed some performance uh like
[06:37] improvements on that in Blackfire and also uh sort of the caveats or downsides also uh sort of the caveats or downsides of this. Yeah. So Franken PHP is now part of the PHP foundation. So that's the great topic of 2025. So uh Franken
[06:53] the great topic of 2025. So uh Franken PHP will be uh sort of more public and more available to a lot of people now. So he showed a little bit of franken PHP So he showed a little bit of franken PHP uh and um sort of a benchmark that was
[07:07] uh and um sort of a benchmark that was made comparing Franken PHP and uh PHP FPM. And the difference here is Franken PHP uh as you might know or not know has this classic mode. Classic mode is very comparable to PHP FBM. It also follows
[07:23] the shared nothing principle. And then also it has the worker mode. The worker mode allows you to run multiple uh PHP uh requests in sequence in the same process without restarting u sort of the PHP engine reusing state from the
[07:39] requests before. So that's a very architecturally different approach of running PHP. So uh and as to be expected and we also showed this in our Franken PHP versus PHP FPM video,
[07:54] PHP FPM video, PHP FPM in engine X is similar to PHP FPM in engine X is similar to Franken PHP um classic mode. So the performance is uh very comparable. You can see the video uh on
[08:08] our channel that shows like a little bit more in detail how it's similar and where differences are. Where fun PHP gets much faster is when you run it in worker mode. And that is to be expected. You don't need to bootstrap the
[08:21] application over and over again. You only bootstrap it once and then uh reuse it. Also latency decreases in this case with you don't have to bootstrap. Then he links to a discussion uh on the Franken
[08:36] PHP project about the performance of classic mode versus PHP FPM. also referencing our YouTube video and blog post about it and u sort of like some post about it and u sort of like some very deep uh
[08:50] very deep uh um dive into specific things uh where at as the end result they found a way to improve Franken PHP classic mode and uh improve Franken PHP classic mode and uh caddyy go in general by um sort of
[09:04] caddyy go in general by um sort of improving uh latencies of like uh under under duress um so tail latency can be improved by that and uh I'm happy to see how this improves the benchmark. Uh we might redo the benchmarks in the
[09:18] future because of this. Though uh again even with this change I don't expect the difference between PHP FPM and Franken PHP classic mode um to be uh significantly different. It architecturally it should be the same.
[09:31] So uh there's really no uh reason why this should be different. Uh the reasons where uh Franken PHP can shine uh specifically with respect to performance is that you can uh write extensions in Go. Uh Go is much more um suitable to
[09:49] write for like a a vast amount of developers than C. So it's easier to write an extension in Go than in C and like benefit from the raw performance like benefit from the raw performance difference between BHP and Go code. and
[10:03] Antoine showed like how he did this with um sort of like generating QR codes uh and how it's much faster to do it with like a native extension than doing it like a native extension than doing it with a PHP based implementation.
[10:17] So that was his talk. The second talk that had a performance background uh was uh from runtime to resilience scaling PHP by Paul Draonus. I wasn't able to see this talk because I went to a different talk also performance related
[10:33] but I want to point out his repository Draona Symphfony 2025 scaling where he has like a demo application that shows uh a way to set up the PHP application
[10:45] for large scale and uh uh good performance. Uh he documents it here uh and shows the different uh sort of parts this application has. Specifically, he showed FPM and Franken
[11:01] PHP both. So, you can take a look at that. And also integrating into sort of that. And also integrating into sort of metrics uh stacks. Uh for this, you can scroll down a little bit. There's a a page that shows
[11:15] little bit. There's a a page that shows FPM configuration. Uh so, uh we also have a bunch of blog posts on the types block on FPM configuration, what you can do to optimize that. uh a second page about the PHP INI with opache
[11:28] configuration uh and other important performance related settings and uh then uh the thing that I found quite interesting uh yeah the metrics endpoint and export.
[11:44] uh yeah the metrics endpoint and export. So one thing he showed is that uh he has a metric endpoint to export and uh he uh exports opcache related
[11:57] and uh he uh exports opcache related information uh in a prometers compatible format and uh uh this is quite cool because that is not something that uh PHP has built in natively at the moment. So what
[12:12] he does in this Symfony demo application, he has a metric controller and the metrics controller using opach get status uh returns sort of various
[12:25] get status uh returns sort of various different metrics in the prometoise text format. So the plain text format and then you can hook it into prometoise and uh send it up to a metric uh collection tool like Rafana. The third talk I
[12:39] watched is uh Clickhouse for Symphony developers. And the reason uh I did that is that uh Clickhouse is a very efficient time series database efficient time series database uh that uh allows to store data in a
[12:54] columnar way not in a row based way. And there's like a lot of uh improvements this has for performance for time series. So if you're collecting data
[13:06] based on time then you can uh efficiently do that with click house and uh recently like a lot of companies are using click house to store uh performance data analytics data logging data and all this kind of stuff and uh I
[13:22] was interested in click house uh for a long time. So you even find like uh sort of like ideas and thoughts I had about click house like on the early repository uh and uh I've always been watching this because I found it might be interesting
[13:38] to use in tight base internally. So up until today we still use elastic search because we have a very elegant way of pre-agregating the data uh inside sort
[13:50] of the satellite demon agent structure on our customer servers. So uh a lot of the benefits of click house are sort of the efficient way of aggregate so inserting data and then immediately aggregating it. But since we do this
[14:05] step already in our architecture much earlier we already store aggregated data and uh so we do that in elastic search and uh we never had a really a reason to
[14:18] uh migrate to click house because it's already quite fast and efficient for us. So Roman had a demo application for his talk uh Click House Symphony Symphfony Con where uh sort of he showed how to implement a very simple uh sort of
[14:36] implement a very simple uh sort of Blackfire clone uh using Click House and Symphony. Uh so Roman is working on the Blackfire team at uh Upson. And uh let me look a little bit at how it works.
[14:53] it works. So he has different commands here about filling tables. Let me look.
[15:08] talk. So it was a bit easier to see there. Uh so one thing he said about using click house was that click house is uses an SQL syntax. is uses an SQL syntax. So the syntax is SQL like um but you
[15:23] communicate with it using HTTP and if you insert data which is sort of the main operation in a column database then you always should do it in batches. So he was saying like around 1,000 rows and uh at the time and to make that possible
[15:40] you have to have like a a message Q setup. So his example has a a message monitoring data and then he has a handler as well.
[16:00] data and then it flushes the data every once in a while doing an insert uh by uh directly sort of importing JSON into the database. So that was quite interesting to see uh
[16:15] So that was quite interesting to see uh how how they use uh click house um to to store monitoring data. So the fourth talk that I watched that was performance related was the talk about Symfony and Rust accelerating hot pass with FFI by
[16:32] Mitchell Verger. And uh he had an example application And uh he had an example application where he showed how he replaces PHP code with uh Rust code. So he had two simple functions and the
[16:48] main idea was to just to show how it works how can you can use the FFI works how can you can use the FFI extension in PHP
[17:02] functions. Uh Uh so the way it works is you sort of uh declare a header and then load a a shared object and uh Michael showed in
[17:18] this talk how uh you can compile Rust code to ex sort of output a shared object what you need to do to make it callable from the FFI extension. And I
[17:31] think that was great to see. uh he had some caveats and mentioned that uh there are only a few use cases to do that in this case uh because it required sort of the a lot of the logic to be on the rust side and then return like simple data
[17:47] structures back to the PHP side. So it's only sensible to do this if you have only sensible to do this if you have like very slow PHP code that is sort of encapsulated a big bunch of logic uh maybe mathematical computation
[18:03] uh some uh algorithm uh that performs work. So one thing uh that he mentioned uh a little bit but uh little bit but uh extrust PHP
[18:17] extrust PHP was also that there is this uh uh second way of uh building PHP extensions in Rust. Uh and that's that's quite interesting and I played around with this as well uh a few times before
[18:32] next year. Um so that that is interesting and hopefully I think it has more applications than doing it via FFI because FFI by default is not enabled in web context and it has some uh security
[18:48] web context and it has some uh security implication to do that. So uh it uh it's a bit uh complicated to use compared to this approach. So the last uh this approach. So the last uh performance related talk uh I went to is
[19:02] my own talk. So I had a talk about native lazy objects and how they will change doctrine and symphony forever. Uh so this is me on stage uh giving this talk and uh in this talk about native lazy objects I sort of summarized the
[19:18] three videos that I made on this channel on native lazy loading uh a PHP 8.4 for feature, how we integrated it into doctrine, how it was integrated into Symfony, uh maybe how it will improve Magento and sort of uh weave a story
[19:34] about this and show how this feature works and uh improves the PHP uh uh works and uh improves the PHP uh uh community uh and ecosystem. You can find the slides for this talk uh in the description
[19:48] and also the videos uh on the channel obviously just to go through the slides a little bit. So one thing I want to highlight is I talked about uh how code generation was used to implement proxies since 2010
[20:03] in doctrine. Uh the downsides of code generation and then also the history in doctrine uh proxy manager symfony and then at the end in PHP making this feature happen. If you're interested in watching the
[20:18] talks uh the symfony page has a sort of a way to watch the replays. It's a paid option uh but uh then you can sort of conference. This is my recap of Symphfony 2025 uh in sort of terms of
[20:34] PHP performance. Uh outside of that, I had a lot of fun, met a lot of uh cool had a lot of fun, met a lot of uh cool people, friends and new people. And uh I would like to especially thank the symfony team because they put on like a
[20:48] really great conference uh with a lot of attention to detail uh that I wasn't used uh to before. So it was really a perfect conference and uh also the 20
[21:00] year of symphony celebration party at on the Thursday evening like this was really great and I had uh like it was really great to be there. So uh thank really great to be there. So uh thank you for watching uh this video and also
[21:15] thank you for being a part of this in 2025. Uh I hope to see you next year and um if you want to make sure that you don't miss a video uh please subscribe to the channel. You can also um click a link in the description to our
[21:31] where we send you information about the new videos and also other technical blog new videos and also other technical blog posts. And uh then I uh yeah wish you u uh very great holidays and hope that you get into the next year and we'll see
[21:47] get into the next year and we'll see each other there. Bye.