Features Releases

New in 3.0: Support of profiling with Zend Debugger

Hello guys,

Sometime ago we announced integration with Xdebug profiler in PhpStorm 3.0. This time we want to introduce you integration with another popular CPU profiling extension for PHP – Zend Debugger.

The set of views which PhpStorm builds by analyzing a Zend Debugger profiler snapshot is the same as for the Xdebug profiler:

  • ‘Execution Statistics’ – displays summary information about execution metrics for every called function/method.
  • ‘Call Tree’ – displays the execution paths of the called functions.
  • ‘Callees’ – same as ‘Call Tree’ but with the selected function as the root.
  • ‘Callers’ – all the paths that can result in calling the selected function.

In order to start a profiling session you need to install and configure the Zend Debugger extension. If you have already configured Zend Debugger for debugging, use this configuration for profiling. Alternatively, follow the Zend Debugger installation guide.

Next, you need to enable Zend Debugger to start capturing profiling snapshots on the required web pages. Just like during a debugging session, you need special cookies set in your web browser. You can do it manually, but it would be handier to use our browser bookmarklets which will set all the necessary cookies for you.

Let’t start profiling with Zend Debugger and browser bookmarklets

  1. Open IDE
  2. Enable listening for incoming connections from Zend Debugger

    Listening for incoming connections enabled

  3. Open browser and navigate to the web page you want to profile
  4. Click the ‘zend Start Profiler’ bookmark

    'zend Start profiler' bookmarklet on the browser bookmarks toolbar

  5. Refresh the page
  6. Switch to the IDE and accept the incoming connection from Zend Debugger (this dialog will appear only once, if you have never accepted connections from this host before)

    'Incoming Connection From Zend Debugger' dialog

  7. Let’s start hunting for bottlenecks in your code!

    Profiler snapshot opened in the PhpStorm

  8. After you have finished your profiling session, click the ‘zend Stop profiler’bookmark to stop capturing profiling snapshots (it will remove the cookie which triggers profiling)

    'zend Stop profiler' bookmarklet on the browser bookmarks toolbar

PhpStorm 3.0 download is available on official download page.

Develop with pleasure!

image description