![]() ![]() You’ll also see nodes with a colored background, those are the most intensive nodes of your request. Blackfire will highlight which paths in your application are also the most time-consuming ones, those are called hot paths. The most important one is the call graph: it is a visual representation of all the methods that were called during the current request, and which of them took up most of the time. Now click on the other big red “View profile” button and you should be redirected to a screen that looks like this: Understanding Blackfire profiles ![]() You will see a bar appear at the top of your page, it’ll run for a very short while and then give you information about the current request: Then go on a webpage, click on the Blackfire icon, and then on the big red “Profile” button. The easiest way to debug an application on a server where Blackfire is present is to get the Chrome extension (or Lynx or whatever). Blackfire just has to be installed on the server that runs it and it’ll hook itself into PHP to gather statistics. It can be any application, you do not need to add any code to it. Now that we have Blackfire, what can we do with it? Let’s try to profile the performances of a PHP web application. You can see more information in the Getting Started of the documentation. Even better: want to install Blackfire from a service like Forge, Fortrabbit or Heroku? It’s integrated right into them, just need to fill a form and you’re good to go: If you’re on a Mac per example this is how you install Blackfire: brew tap blackfireio/homebrew-blackfireĪnd that’s it. Setupįirst, it is very easy to install, and the documentation to do so will get you started in 30 seconds. It’s tailored for doing advanced performance profiling of PHP applications – be it web applications, CLI tools, packages, etc. Blackfireīlackfire is a tool created by Sensiolabs – which you may know from this little unknown framework called Symfony or from SensioLabs Insights. ![]() Today I want to make you discover Blackfire if you don’t already know it, because I feel like it’s not as known as it should be. Where all the toys would be made of candy. When I discovered it during its first public beta I was like a kid in a toy store. Recently Blackfire came out of beta, it’s a tool aimed at making all these profiling options a thing of the past by providing a modern powerful performance analysis tool, that is both quick and easy to use. Or if you’re courageous like I was for a long time, you use xdebug snapshots which requires you to configure it, and then parsing the snapshots which takes a long time, etc. There are several ways to ease the pain a little: debug bars, putting timers a bit everywhere. If you’ve ever worked on any PHP application, or package, or anything you know that debugging performance issues is hard. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |