Assertions

Blackfire profiles contain an "assertions" tab displaying the results of all the performance tests matching the profiled request or CLI command.

You can have as many assertions as you need. They are automatically evaluated, ensuring you can enforce performance expectations in the long run.

It is good practice to write tests on the cause of performance, not its consequences. Tests on time or memory consumption can be volatile, leading to false negatives.

Basing the tests on reliable metrics such as the number of SQL queries made, entities hydrated, or the number of calls to greedy functions can be an efficient and reliable approach to ensure long-term performance improvement.

Get started with testing your application with our documentation and a series of blog posts