Приглашаем посетить
Добычин (dobychin.lit-info.ru)

What Is Needed in a PHP Profiler

Previous
Table of Contents
Next

What Is Needed in a PHP Profiler

A profiler needs to satisfy certain requirements to be acceptable for use:

  • Transparency Enabling the profiler should not require any code change. Having to change your application to accommodate a profiler is both highly inconvenient (and thus prone to being ignored) and intrinsically dishonest because it would by definition alter the control flow of the script.

  • Minimal overhead A profiler needs to impose minimal execution overhead on your scripts. Ideally, the engine should run with no slowdown when a script is not being profiled and almost no slowdown when profiling is enabled. A high overhead means that the profiler cannot be run for production debugging, and it is a large source of internal bias (for example, you need to make sure the profiler is not measuring itself).

  • Ease of use This probably goes without saying, but the profiler output needs to be easy to understand. Preferably there should be multiple output formats that you can review offline at your leisure. Tuning often involves a long cycle of introspection and code change. Being able to review old profiles and keep them for later cross-comparison is essential.


Previous
Table of Contents
Next