DBG and CLI + what is expected performance impact? |
Site Admin
|
Debug and profile from CLI is still possible There are two ways -- you can either run your script with DBGSESSID variable either in environment or in command line, or you can do this right in the IDE. See Run->CLI (console) to set CLI mode.
Impact depends on what your script is doing. If it is IO-bound, like DB reader/writer or network socket reader/writer, debugger impact is negligible. If it is CPU bound _and_ performs many function calls in tight loops, debugger impact can be measurable as, like for instance 5%. It's because debugger has to track what php is doing to be able to start right-away when DebugBreak() function is called, and it is tracking when it is just loaded and enabled. |
||||||||||||
_________________ The PHP IDE team |
|
Tnx for explanactions.
How can I set DBGSESSID in command line? Is it enough I pass it as an argument to the script run from Cli? Could you please provide an example? Is there any impact on performance when dbg extension loaded and profiler / debugger disabled from php.ini? |
||||||||||||
|
Site Admin
|
example with environment:
$ DBGSESSID="1@mydesktopip:7869;d=1" myscript.php example with command line argument: $ myscript.php DBGSESSID="1@mydesktopip:7869;d=1" http://forum.nusphere.com/faq-what-is-dbgsessid-syntax-t586.html http://www.nusphere.com/kb/technicalfaq/faq_dbg_related.htm regarding your 2nd question, debugger is completely deactivated if disabled |
||||||||||||
_________________ The PHP IDE team |
|
Thank you for both answers. I made the second question just because if I do php - v with debugger disabled I still see the dbg fingerprint in the output but probably it just means that was loaded. Good that it doesn't create load. This way I can set disabled as default setting and I enable it in php-fpm. This way is disabled in CLI and enabled via web.
I'll follow the two links you kindly provided. Thank you for you excellent support. |
||||||||||||
|
|
Hi Dmitri,
I've a small request for a new feature. To avoid putting and remembering the long debugger string at command line (BGSESSID="1@mydesktopip:7869;d=1") we could put it in a php.ini variable and only use BGSESSID as parameter when running the script. If we put the full current version you use the command line information, while if we put only the short version you take the other settings from php.ini Don't know if you like. |
||||||||||||
|
Site Admin
|
it wouldn't work for teams
|
||||||||||||
_________________ The PHP IDE team |
|
You're correct. Teams could continue to use current mode. It's just a shortcut for indivudals
|
||||||||||||
|
|
extra clarification: if debugger and profiler are enabled is there any impact of performance if a debug/profile session is not started?
|
||||||||||||
|
Site Admin
|
extra clarification: impact in real systems is almost always negligible like 0.00007%. In case if your script does not read any data from sources like databases, key-values, or any other files, and produces no output, and performs only function calls, impact is the highest but nevertheless it would around several percents.
extra clarification: yes, even if debug or profile session hasn't started, debugger still takes some CPU cycles to track execution context. You can call DebugBreak anywhere in your code, right? Debugger should be able to run from this point, so the context should be valid, that's why tracking is needed. Again, it's highly optimized code, it's amortized and impact is negligible. |
||||||||||||
_________________ The PHP IDE team |
|
thank you Dmitri, very detailed answer.
|
||||||||||||
|
DBG and CLI + what is expected performance impact? |
|
||
Content © NuSphere Corp., PHP IDE team
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by