Xdebug Profiler

Open Source

by Xdebug

Provided by Xdebug

Not yet rated
Platform
Web
Pricing
Open Source
Account required
No
Ads
None
Last verified
8 hours ago
Developer
Xdebug
Official URL

Overview

The Xdebug profiler is the part of the Xdebug PHP extension that records where a script spends its time and memory. Instead of guessing which function is slow, you run the script with profiling on and read a report of every function call, how often it happened and how long it took.

It is switched on by setting xdebug.mode to profile. Xdebug then writes a file in the Cachegrind format to an output directory for each request. In profile mode every request is profiled by default; setting xdebug.start_with_request to trigger limits it to requests that carry the XDEBUG_TRIGGER variable, cookie or parameter, which is the sensible choice on a busy development site. Files are GZip-compressed by default since Xdebug 3.1.

Xdebug does not display the results itself. You open the files in a separate viewer: KCacheGrind on Linux, QCacheGrind on Windows and macOS, the browser-based Webgrind, or PhpStorm. The viewers show time spent in a function alone and including the functions it calls, call counts, memory use, and who called what. The profiler is free as part of Xdebug and is meant for development machines, since it adds overhead and its output files can become very large.

Features

  • Records time, memory use and call counts for every function
  • Writes Cachegrind-compatible files, one per request
  • Self time and inclusive time for each function
  • Profile every request or only those carrying a trigger
  • Configurable output directory and file name pattern
  • GZip compression of output files since Xdebug 3.1
  • Files open in KCacheGrind, QCacheGrind, Webgrind and PhpStorm
  • XDEBUG_MODE environment variable for command-line runs

Privacy

See the official privacy policy. Profiles are written as files to a directory on the machine running PHP; nothing is sent elsewhere by the profiler.

Pros & Cons

Pros

  • Free and open source as part of Xdebug
  • Standard Cachegrind output works with several existing viewers
  • Trigger mode keeps profiling limited to the requests you choose
  • Covers memory as well as time

Cons

  • Needs a separate viewer program to read the results
  • Profile files can become very large for complex scripts
  • QCacheGrind cannot read the compressed files, so compression has to be turned off for it
  • By default every request is profiled once the mode is on, so it does not belong on a live site

Community Reviews (0)

No written reviews yet — be the first to rate this tool.

Similar Tools

  • Profilers · py-spy

    Profiles running Python programs without modifying them.

    Not yet rated
    Open Source Windows Linux
  • Profilers · Blackfire

    Profiles and monitors the performance of PHP and Python applications.

    Not yet rated
    Paid Web