Code Profiling of Programs Komodo IDE only
The Komodo code profiler is a tool that will analyze programs on a function by function basis, tracking which function calls are made, which functions call info other functions and how long these calls take to complete.
Komodo only provides Code Profiling support for Python and PHP (PHP version 5.2 or higher), though Komodo's profiler interface can also read these profiling formats:
- Callgrind/Cachegrind/KCachegrind - such as Xdebug's PHP code profiler produces
- pstats - produced by the Python cProfile and Profile standard library modules
Komodo's Code Profiler interface can be launched from the Tools > Code Profiler menu, where you can load previously executed profiling sessions (files).
Starting a new Code Profiling session
You can either perform code profiling on a local file of your system Local Code Profiling, or alternatively use Komodo's Remote Code Profiling facilities to launch code profiling on a different system and then connect back to Komodo (via the network) to display the code profiling results.
Local Code Profiling
In order to create a new Local Code Profiling session, use the Debug > Start Code Profiling menu.
By default, the Profiling Options dialog box is displayed (which has the same fields as the regular debugger options dialog). If multiple files are open in the Editor Pane, the program that is currently displayed will be profiled. Komodo will track the progress of the application as it executes and when the program finishes, Komodo will display the results in a separate code profiling window.
Remote Code Profiling
Remote profiling involves executing code on a remote machine and then connecting back to Komodo (through the Komodo debugger port) in order to display the code profiling results.
Python Remote Code Profiling
For Remote Code Profiling of Python applications, you will need to launch the "pydbgp" application and add the --profiling command line option. See Komodo's Python Remote Debugging documentation for further details.
PHP Remote Code Profiling
For Remote Code Profiling of PHP applications, you will need to be using PHP 5.2 or higher, and be using the xdebug library that is included with Komodo IDE (or included from the Komodo PHP remote debugging files). See Komodo's PHP Remote Debugging documentation for the basic configuration details, then change the Xdebug remote_mode setting to be "profile", i.e.:
xdebug.remote_mode=profileAny remote code that is run with this configuration will connect back to Komodo and send the PHP code profiling information. Note: this connection will occurs at the end of PHP application's execution.