You are here: User Guide > Concepts > Profiling

Profiling

The Zend Profiler displays a breakdown of the executed PHP code in order to detect bottlenecks in scripts by locating problematic sections of code. These are scripts that consume excessive loading-time. The Profiler provides you with detailed reports that are essential to optimizing the overall performance of your application.

See below for a list of the five different profiling methods Zend Studio includes.

PHP CLI Application

Allows you to profile files on your workspace using Zend Studio's internal debugger.
The Internal Debugger enables developers to locally validate freshly developed code before deploying to a web server. The internal option means that only files located in local directories can be profiled. When profiling internal files the Zend Studio Internal Debugger uses its own PHP executable that was installed together with Zend Studio.

 

See Locally Profiling a PHP Script for more information.

Note:

Your server must be running the Zend Debugger or XDebug in order for remote debugging and profiling capabilities to function.
The Zend Debugger comes bundled with Zend Server, but can also be downloaded as a separate component from http://www.zend.com/en/products/studio/downloads. For instructions on manually installing the Zend Debugger, see Installing the Zend Debugger.

PHP Web Application

Allows you to profile applications situated on a server. It allows you to profile whole applications and projects.

The PHP Web Page Profile setting has an option to give the files you are working on first priority when profiling, using the ”Local Copy” option. This means that, when possible, file content is taken from the files situated on your Workspace. This prevents you from having to upload the latest revisions.

Note:

It's recommended that your local project structure reflect the project structure on your server.

See Profiling a PHP Web Page  for more information.

Note:

Your server must be running the Zend Debugger or XDebug in order for remote debugging and profiling capabilities to function.
The Zend Debugger comes bundled with Zend Server, but can also be downloaded as a separate component from http://www.zend.com/en/products/studio/downloads. For instructions on manually installing the Zend Debugger, see Installing the Zend Debugger.

URL Profiling

Allows you to enter a URL to profile an application on a server. Only server files will be profiled, so the files do not need to exist locally in your Workspace.

 

See Profiling a URL for more information.

 

Once a Profile session has been executed (see Using the Profiler for more information on how to execute a profiling session), various views in the Profiling Perspective provide information on the performance of your script. See PHP Profile Perspective for more information on the various views.

 

Toolbar Profiling

Profile files and applications directly from your browser.

 

See Profiling Using the Zend Debugger Toolbar for more information.

Profiler Views

Profiler Information view

Provides general information on the profiling duration and date, number of files constructing the requested URL and more. In addition, it displays a Time Division Pie Chart for the files in the URL.
The right side displays time division in a pie chart and the left side provides the following information:

Profiler Information

Execution Statistics view

Displays the list of files that were called during the profiling process and detailed information on processing times for elements within the files. The window contains statistics relevant to each element as follows:

Execution Statistics

Note:

Click the 'Show as percentage' button on the toolbar to see the statistics as percentages rather than times.

Right- clicking a function in the list gives you the option to 'Open Function Invocation statistics'. This will open a view with statistics about the selected function, the functions it was invoked by and functions that it invoked.

Execution Flow view

Shows the flow of the execution process and summarizes percentages and times spent on each function.

Profiler Execution Flow

Right-clicking a function in the list gives you the option to:

Code Coverage Summary

Summary of how many lines of code were covered during the Profiling process.

Code Coverage Summary

Clicking on the 'Covered lines' percentages will open an editor containing the file, with the covered lines highlighted:

Covered Lines

 

 

Related Links:

Using the Profiler

Using the Debugger

PHP Profile Perspective 

 

 

©1999-2012 Zend Technologies LTD. All rights reserved.