开发者

PHP Optimization - Eclipse w/ PDT (via XDebug)

开发者 https://www.devze.com 2023-02-28 08:09 出处:网络
How do I use the开发者_运维问答 Debugger to optimize my code?I\'m using too much memory, my understanding is that the debugger has built in tools which help with optimizing code?XDebug, among other th

How do I use the开发者_运维问答 Debugger to optimize my code? I'm using too much memory, my understanding is that the debugger has built in tools which help with optimizing code?


XDebug, among other things, allows you to profile your code, saving the profiling information to a file, which can be opened by analyzer programs, that can visualize how the control flow went, and how much time was spent in each function.

It helps you find bottlenecks, or slow parts in your code, but it won't directly optimise your code, you have to look at the data, and determine for yourself which parts to refactor.

You can enable the profiler by adding these settings to your php.ini:

xdebug.profiler_enable=1
xdebug.profiler_output_dir=c:\temp\

The documentation about the profiling feature of XDebug can be found on the official page.

0

精彩评论

暂无评论...
验证码 换一张
取 消