5

I am trying to get XDebug working on my local wamp installation (Uniform Server 8).

However when I put
xdebug.remote_enable=1

in my php.ini, which is required for my IDE to use xdebug, loading the pages gets really slow as in 5 seconds per page slow. The debugger works though.

I haven't used xdebug before but I can imagine that it normally shouldn't take this long. I'm pretty sure it might have something to do with using the symfony2 framework.

Does anyone have an idea what's causing this?

Geoffrey De Vylder
  • 3,963
  • 7
  • 36
  • 56
  • ive noticed from symfony's profiler, that the big slowdown is in `firewall` event.... – Ascherer Oct 03 '12 at 15:03
  • Consider using Linux ;) I was amazed to discover that Symfony runs about 10x faster. An average pageload on a bigger project on windows was an annoying 8 seconds, while on Linux the same application, the same page takes only 800 ms. Adding xdebug on linux is a breeze and you hardly notice performance differences. – Rein Baarsma May 07 '19 at 08:32
  • I'm running linux and everything was nice and quick, then suddenly xdebug slowed to a crawl. I have to literally click pause because step over no longer works. No idea why. – geoidesic Aug 01 '20 at 16:41

2 Answers2

1

As per another answer on SO, you need to set xdebug.remote_autostart = 0 in your php.ini

Geoff Kendall
  • 1,307
  • 12
  • 13
1

It's maybe because this is what it does!

Check the default storage place for xdebug logs (most of the times /tmp/xdebug/something) which on Windows would be something different than on unix/linux systems.

set these in your php.ini if you want them placed/named somewhere else:

xdebug.profiler_output_dir Type: string, Default value: /tmp The directory where the profiler output will be written to, make sure that the user who the PHP will be running as has write permissions to that directory. This setting can not be set in your script with ini_set().

xdebug.profiler_output_name Type: string, Default value: cachegrind.out.%p

This setting determines the name of the file that is used to dump traces into. The setting specifies the format with format specifiers, very similar to sprintf() and strftime(). There are several format specifiers that can be used to format the file name.

Generating these files is taxing to your system. But these are what you need to profile your code.

Also go read http://xdebug.org/docs before you actually use it again so that you know what exactly you are trying to do.

ktolis
  • 443
  • 1
  • 3
  • 14
  • Well, I do know what xdebug is used for and I'm planning on using it only for being able to set breakpoints to debug my code. I have disabled the profiler but it's still slow. My question was what could be causing this slowness, not how I set the profiler. – Geoffrey De Vylder Jan 02 '12 at 14:19
  • The profiler has nothing to do with the remote debugger. The debugger does make things slower, but not like this. – Derick Jan 11 '12 at 18:38
  • 1
    @geoffreydv If you use the debugger/profiler you are constantly writing on the disk. This is your bottleneck. You cannot escape that. – ktolis Jan 18 '12 at 16:05
  • Using Virtualbox doesn't seem to be writing to disk, but still is very slow. – arieltools May 20 '12 at 07:56
  • 2
    @arieltools could you elaborate what you mean by "Using Virtualbox doesn't seem to be writing to disk"? It doesn't feel right since it writes data as any other application. – Arkadiusz 'flies' Rzadkowolski Sep 27 '12 at 05:58
  • I am having the same issue and I do not have the profiler enabled. So the profiler is not the issue. I have read that it may have something to do with ipv6, but have not been able to resolve it yet. – computrius Jan 21 '14 at 17:43