Up until now, we have used the Blackfire browser extension to profile a project hosted on Blackfire servers. This was the easiest way to get us started, but now it's time for you to use Blackfire on your own projects.
From this chapter on, we will focus on using Blackfire on PHP code. Even though the core message is unchanged, you might need to adapt installation and usage procedures if you develop Python applications.
Blackfire is a SaaS product. The blackfire.io website allows you to manage your Blackfire project configurations, profiles, and builds. Still, you need to install some software:
When you are manually triggering Blackfire profiles, you will do so using one of the following tools:
Blackfire is supported on many platforms; install it by following the interactive instructions for your operating system:
This tutorial can followed along whether you have an active subscription or not, as all applications used in this book are publicly profilable.
You may want to go the next chapter if you don't currently have a subscription.
When deploying code to testing, staging, or production environments, you can use the same installation procedure as in the previous section, or use Blackfire's integrations with Chef, Puppet, Ansible, or Docker.
Blackfire is also pre-installed on some platforms, such as Adobe Commerce Cloud or Platform.sh. The configuration procedure might be a little different, please make sure to refer to those platform's documentation.
You are now ready to profile your very own projects!
Once you're able to generate a profile, use the profiling methodology we described in the previous chapters to run Blackfire on your applications. I'm very confident that for any non-trivial codebase, you will find some optimizations.
Found an optimization? Share it with us on Twitter and use the #blackfireio hashtag.