FastDebug is a drop-in replacement for Xdebug as a step-by-step PHP debugger. It provides the same exact functionality for debugging but it is 30x faster.
Xdebug is an amazing tool which has helped a lot of PHP developers in the task of debugging their code. Its main problem is that it makes your code run much slower. As soon as you enable it in debug mode your code will run 50% slower. And if you start a debugging session your code can run up to 300% slower.
This means that as soon as you start debugging with Xdebug your code will start to feel sluggish, with page loads taking much longer and commands taking a long time to complete. This makes debugging code a pain and can turn people off from using this tool. You need to resort to tools that will only enable Xdebug when you actually need to debug code, which in itself is another pain.
FastDebug aims to solve this problem by providing a first-class debugger that runs much faster. It is built on a completely new architecture, developed in C++ and has been designed from the word go to provide an optimized experience.
FastDebug has such a small overhead that you can leave it turned on permanently in your development environment, ready to start a debugging session whenever you need it. Running your code is a breeze with no sluggishness
The following table compares the performance of Xdebug against FastDebug. It shows the time it took to run a Symfony cache:clear command under several scenarios and it also shows the increase of execution time in each case.
- The first row is the execution time when no debugger is present.
- The next rows represent the case when the debugger is loaded but no connection is made with the debugging client. You can see that even in this simple case Xdebug will slow your code by more than 50%.
- The next rows represent the case when the debugger is connected to a debugging client but no breakpoint is set. You can see that as soon as Xdebug connects, it slows the code more than 200%.
- Finally the next two groups of rows represent the cases where we set one or more breakpoints. You can see that Xdebug gets progressively slower as you add more breakpoints to your code.
In contrast to all this, FastDebug barely slows down the code, less than 10%, even when you are fully connected to a debugging client. Also, its performance does not depend on the number of breakpoints set.
FastDebug provides exactly the same functionality that Xdebug provides for step debugging of your code:
- Conditional breakpoints
- Temporary breakpoints
- Breakpoints with a hit count
- Step into functions
- Step over functions
- Step out of functions
- Call and return breakpoints (triggered upon entering or leaving a particular function)
- Exception breakpoints (triggered when an exception is encountered)
- JIT debugging where the debugger is only enabled when an error or exception occurs
- Breakpoint resolving
- Retrieval of the execution stack
- Retrieval of all local and global variables
- Evaluation of expressions
- Setting the value of local and global variables
- Redirection of script output to the debugging client
The configuration and activation of FastDebug is exactly the same as the one for Xdebug. It can even use the same environment variables, get/post parameters and cookies. Replacing Xdebug with FastDebug should be as easy as replacing the Xdebug extension file with the FastDebug extension file and replacing the ini settings. All the current tools that work with Xdebug (Browser extensions, IDEs, plugins…) should continue working without any configuration change or modification.
FastDebug does not provide any of the other capabilities that Xdebug provides, like code coverage, profiling or function tracing. FastDebug was designed specifically as a tool to step debug your code and has been optimized to perform this task and nothing else.
FastDebug provides a wide support for PHP versions, starting with PHP 7.0 and continuing up to 8.2, and support for new versions will be available as soon as they are released. We will continue supporting older versions even if they are no longer supported or maintained.
And this is just the beginning, we plan to add additional capabilites to FastDebug, making it not only the fastest PHP debugger but also the best PHP debugger.
We are currently offering FastDebug under a private beta program. If you would like to participate in this program and be one of the first developers to be able to test this amazing tool, please sign up by clicking the button below.