[xdebug-general] Platform Performance Differences

From: Wilks, Daniel <dwilks[@]intacct.com>
Date: Thu, 14 Mar 2013 17:08:15 +0000

Good morning everyone. I was wondering if anyone had noticed significant differences in xdebug performance on OSX vs Linux?

I use Eclipse on OSX and I've gotten used to a slight delay when single stepping. I just happened to go to a colleague's desk and noticed that his debugging performance is what I used to expect - near instantaneous single stepping. Intrigued I tried some unscientific tests on my Mac. One OSX native (OSX 10.8.2 / PHP 5.3 / Xdebug 2.2.1 from Macports), one inside a Ubuntu VM that matched his system (12.04/PHP 5.3/Xdebug 2.1.2), and another Ubuntu VM with a PHP that matched the native one (Ubuntu 12.10 / PHP 5.3 / Xdebug 2.2.1 installed via apt). I just set a breakpoint at the top of our login page and single-stepped my way to the bottom. Also wondering if the debug client had much to do with the performance I also installed PHP Storm (5 and 6) and the results were similar (I didn't set up the tests on my 5.3 VM).

                  OS X Ubuntu 12.04 Ubuntu 12.10
Eclipse 0:21 0:08 0:09
PHP Storm 5 0:26 0:15 --
PHP Storm 6 0:48 0:16 --

Not sure why PHP Storm 6 has worse performance on OSX vs Ubuntu but over a handful of runs it sure appeared to. But in all cases the Ubuntu VM outperformed it's native host.

Wanting to get more precise I threw together a script for debugclient that emulates what eclipse was doing. Set a breakpoint, run, stack_get, context_names, context_get -c 0, context_get -c 1, step_over, … I ran these tests a few times just to be sure that the timings didn't fluctuate wildly. These are representative of the average. Oh, and I'm not sure if it matters but the debugclient in all cases is the one from the 2.2.1 sources.

Test 1: Step, Get Stack, Get Locals, Get Globals. OSX performance (elapsed) is about 2.5x slower. Also looks like php 5.3 and/or xdebug 2.2.1 is sending many more global variables across the wire?

                  OS X Ubuntu 12.04 Ubuntu 12.10
real 0m32.698s 0m12.500s 0m13.240s
user 0m24.199s 0m0.520s 0m1.296s
sys 0m0.510s 0m0.128s 0m0.272s

x (bytes) 18,459,057 12,077,646 16,802,166

Test 2: Just keep stepping (no stack, no context_get). Here the raw single-step performance is (elapsed) a little less than 2x slower on OSX than either Ubuntu.

                  OS X Ubuntu 12.04 Ubuntu 12.10
real 0m7.635s 0m4.132s 0m3.978s
user 0m0.002s 0m0.000s 0m0.000s
sys 0m0.006s 0m0.008s 0m0.004s

So from what I can see Linux outperforms it's native host Mac?

Cheers
Received on Thu Mar 14 2013 - 17:13:50 GMT

This archive was generated by hypermail 2.2.0 : Mon Jun 25 2018 - 06:00:04 BST