PHP Profiler for Visual Studio Code
Xdebug profile files (cachegrind format) can be opened, viewed, and inspected. The extension also highlights hot paths in your code, according to the profiling results. There is more, please see the features below for the details.
PHP code profiling allows you to inspect how much time and how many calls were made to every single function in the code.
The extension enables inspecting of Xdebug profile files which contain information about PHP code performance. It works best in combination with PHP Tools for Visual Studio Code. Debug, profile, and inspect the profiling results right in Visual Studio Code.
Quickly Setup PHP for Profiling
Opening Profiling Result
Open the file containing your profiling data. By default, it is in form of
Using Command Palette
Drag & Drop "cachegrind.out.*.gz" File
Alternatively, if your profile file name is in form of
Inspecting Call Times
The following view lists all the functions with the number of calls (Calls), time spent by the function body (Self Time), and time including nested calls (Time).
The Function Details view is focused on a single function; and displays all the calling functions and all the called functions, including the time information.
Highlighting Hot Paths
The loaded profiling result file is analyzed, and hot paths are highlighted directly in the source code. Highlighting can be turned off in the profiling result view.