This article is part of a series on building a sample application — a multi-image gallery blog — for performance benchmarking and optimizations. (View the repo here.)
本文是构建用于性能基准测试和优化的示例应用程序(一个多图像画廊博客)系列文章的一部分。 (在此处查看回购 。)
Throughout the past few months, we’ve introduced Blackfire and ways in which it can be used to detect application performance bottlenecks. In this post, we’ll apply it to our freshly started project to try and find the low-points and low-hanging fruit which we can pick to improve our app’s performance.
在过去的几个月中,我们介绍了Blackfire及其用于检测应用程序性能瓶颈的方法。 在本文中,我们将其应用于新近启动的项目,以尝试找到可以提高应用程序性能的低点和低落的果实。
If you’re using Homestead Improved (and you should be), Blackfire is already installed.
如果您正在使用Homestead Enhanced (应该如此),则已经安装了Blackfire。
While it’s useful to be introduced to Blackfire before diving into this, applying the steps in this post won’t require any prior knowledge; we’ll start from zero.
在深入探讨Blackfire很有用之前,应用本文中的步骤不需要任何先验知识; 我们将从零开始。
建立 (Setup)
The following are useful terms when evaluating graphs produced by Blackfire.
以下是评估Blackfire生成的图形时的有用术语。
Reference Profile: We usually need to run our first profile as a reference profile. This profile will be the performance baseline of our application. We can compare any profile with the reference, to measure the performance achievements.
参考资料 :我们通常需要将第一个资料作为参考资料运行。 此配置文件将成为我们应用程序的性能基准。 我们可以将任何配置文件与参考进行比较,以衡量绩效。
Exclusive Time: The amount of time spent on a function/method to be executed, without considering the time spent for its external calls.
独占时间 :不执行外部调用所花费的时间,花费在要执行的函数/方法上的时间。
Inclusive Time: The total time spent to execute a function including all the external calls.
包含时间 :执行一个功能(包括所有外部调用)所花费的总时间。
Hot Paths: Hot Paths are the parts of our application that were most active during the profile. These could be the parts that consumed more memory or took more CPU time.
热路径 :热路径是我们的应用程序中在配置文件中最活跃的部分。 这些可能是消耗更多内存或花费更多CPU时间的部分。
The first step is registering for an account at Blackfire. The account page will have the tokens and IDs which need to be