WebãµãŒããŒã管çããéããšã³ãžãã¢ã¯ãµã€ãã®äžè¬ãŠãŒã¶ãŒããã¹ããŒããŸãã¯ãã¹ããŒããŠã³ããšåŒã¶åé¡ã«ééããããšããããããŸãã ãã¡ãããããã¯éåžžã«éèŠãªåé¡ã§ããããµã€ãææè ã«æ·±å»ãªè²¡æ¿ç圱é¿ãäžããå¯èœæ§ããããŸãã ãŠãŒã¶ãŒãWebãµã€ãã®ææè ãéåžžWebãµãŒããŒç®¡çè ã«é£çµ¡ããã®ã¯ããã®ãã¹ããŒã¯ãŒã¯ããšããèšèé£ãã§ããããã®èšèé£ãã¯ãã¹ãŠã蚺æããã®ã«ååã§ãã
èå³æ·±ãããšã«ããã®ãããªåé¡ã®åå ã¯ã»ãšãã©ã©ãã«ã§ãé ãããŠããŸãã ãŸããããã€ãã®çç±ããããåé¡èªäœãåçŸããã®ãé£ããå ŽåããããŸãã ãŠãŒã¶ãŒãæçµçã«äžäœã¬ãã«ã§ããã¬ãŒãããšããŠåé¡ãããã®ã¯æ¬¡ã®ãšããã§ãã
- ãµã€ããžã®ãããã¯ãŒã¯ã¢ã¯ã»ã¹ãã£ãã«ã®é ââ延
- ãµãŒããŒã®ããŒããŠã§ã¢ã®åé¡
- ãµãŒããŒãªãœãŒã¹ãäžè¶³ããŠããŸã
- æºæé©ãªãªãã¬ãŒãã£ã³ã°ã·ã¹ãã
- æé©ã§ã¯ãªããœãããŠã§ã¢
- ãµãŒãããŒãã£ã®ãªãœãŒã¹ãžã®ã¢ã¯ã»ã¹ã«é¢ããåé¡ãã¢ã¯ã»ã¹ã¯åæçã«å®è£ ãããŸã
- æé©ã§ãªããµã€ãã³ãŒã
管çè ã®ã¿ã¹ã¯ã¯ããããã®åé¡ãç¹å®ããå¯èœã§ããã°æé€ããããšã§ãã ãã¡ããã圌ãã圌ã®è²¬ä»»ç¯å²å ã«ããå Žåã ãããŠæåŸã®ããããŠããããæåŸãã2çªç®ã®ãã€ã³ãã¯ã圌ã®è²¬ä»»ç¯å²ã«ã¯å«ãŸããŠããŸããã ããããåé¡ããããã®ç¹ã«æ£ç¢ºã«ããããšã瀺ãããšãå¿ èŠã§ãã
åŸè ã®ã±ãŒã¹ã«ã€ããŠã¯ãèšäºã§èª¬æããŸãã å®è·µã«ãããšããã®ã±ãŒã¹ã¯ãµã€ãã®é ãåäœã«é¢é£ãããã¹ãŠã®åé¡ã®çŽ90ïŒ ãå ããŠããŸãã æé©ã§ãªãã³ãŒããäžååãªSQLã¯ãšãªãäžé©åãªããã¯ã®äœ¿çš-ããããã¹ãŠããµã€ãã®é床ãäœäžãããå¯èœæ§ããããŸãã ãããŠãããæç¹ãŸã§åŒ·åãªããŒããŠã§ã¢ãäžè¯ã³ãŒãããã€ãžã§ã¹ãã§ããå Žåãããæç¹ãxããåºçŸãããšãåã«è² è·ã«å¯ŸåŠããªããªããŸãã 容éãããã«å¢ããããšã¯å¯èœã§ããã第äžã«ããã€ãã¯äœ¿ãæãããã第äºã«ãããã¯äžå¿ èŠãªèšåã³ã¹ãã§ãã ãããã£ãŠããŸãåé¡ã®è§£æ±ºçã¯ããµã€ãã³ãŒãã®åæããå§ããå¿ èŠããããŸãã
æ°ããããŒããŠã§ã¢ã®ååŸã¯ã倧éã®ã³ãŒãã解æããã³ç·šéãããããçµæžçã«å©çãããå Žåãããããšã«æ³šæããŠãã ããã
å¥åŠãªããšã«ã管çè ã®ã¡ã€ã³ã¿ã¹ã¯-ãµãŒããŒç®¡çã 圌ã¯éçºè ã§ã¯ãªããããšãããŸãæ©èœããªããŠããã³ãŒãã«è§Šããé埳çæš©å©ã¯ãããŸããã ãããã£ãŠããã®ã³ãŒãã®æã詳现ãªèšºæãè¡ããWebãµã€ãã®åäœãé ããªãããã«ããã¯ãç¹å®ããã«ã¯ãã³ãŒãã®ç·šéãå¿ èŠãšããªãããŒã«ã䜿çšããå¿ èŠããããŸãã
ã¯ããç§ã¯å®å šã«å¿ããŸãããããã¯PHPã§éçºããããšã§ãïŒ ã»ãšãã©ã®Webããã°ã©ããŒã¯ããã䜿çšããæããŠããŸãã ãæããç ç²ã«ããŠã質åã¯ããªãç©è°ãéžããŠããŸãã
Xdebug
Xdebugã¯ã PHPéçºè ã®1人ã«ãã£ãŠèšè¿°ãããPHPæ¡åŒµæ©èœã§ããã PHPã³ãŒãã®ãããã°æ å ±ãåéããã³åæããããã«èšèšãããŠããŸãã ããã¯ãªãŒãã³ãœãŒã¹ãããžã§ã¯ãã§ããããšã«æ³šæããããšãéèŠã§ãã
ã·ã¹ãã 管çè ã®ããªãºã ãéããŠxdebugãæ€èšããŸããããã¯ããµã€ãã³ãŒãã®ç·šéãå¿ èŠãšããããµãŒããŒã®é床ãäœäžãããªãæ©èœã®ã¿ã«åœ±é¿ããŸãã
æããã«ããããã¡ã€ãªã³ã°ãŸãã¯ãã¬ãŒã¹ã¯ãã³ãŒãå®è¡äžã«è¿œå ã®é 延ããããããŸãã ãããã£ãŠã蚺æã¯ãµã€ãã®ããã©ãŒãã³ã¹ã«åœ±é¿ãäžããŸããã
Xdebugã®ã€ã³ã¹ããŒã«
Centos / RHEL / Fedoraã䜿çšããå Žåãxdebugãã€ã³ã¹ããŒã«ããæãç°¡åãªæ¹æ³ã¯EPELãªããžããªããã€ã³ã¹ããŒã«ããããšã§ãïŒ
$ yum install php-pecl-xdebug
peclã䜿çšããã€ã³ã¹ããŒã«ïŒ
$ pecl install xdebug
æåã«http://xdebug.org/download.phpããããŠã³ããŒãããŠããœãŒã¹ã³ãŒãããxdebugãã€ã³ã¹ããŒã«ããããšãã§ããŸãã
$ tar xvzf xdebug-2.2.1.tgz
$ cd xdebug-2.2.1
$ phpize
$ ./configure --enable-xdebug
$ make && make install
Xdebugã»ããã¢ãã
åºæ¬çãªã»ããã¢ããã¯ãæ°ããã€ã³ã¹ããŒã«ããæ¡åŒµæ©èœãphp.iniãã¡ã€ã«ã«åçŽã«æ¥ç¶ããããšã§ã ã ãã®ãã¡ã€ã«ã§ã¯ã次ã®è¡ã®ååšã確èªããå¿ èŠããããŸãã
zend_extension = /path/to/xdebug.so
xdebug.default_enable = 0
xdebug.overload_var_dump = 0
è¡ãphp.iniãŸãã¯ã€ã³ã¯ã«ãŒããã¡ã€ã«ã®1ã€ïŒããšãã°/etc/php.d/xdebug.ini ïŒã«è¿œå ãããŠããªãå Žåãæåã§ãããè¡ãå¿ èŠããããŸãã 次ã«ãWebãµãŒããŒãåèµ·åããŸãã
ãã®ç¬éããããµã€ãéçºè ã¯ãçè«çã«äœ¿çšã§ããæ°ããxdebugé¢æ°ãèªç±ã«äœ¿çšã§ããããã«ãªããŸããã æåã®2ã€ã®ãã£ã¬ã¯ãã£ãã¯ããšã©ãŒãçºçãããšãã«é¢æ°åŒã³åºãã®ã¹ã¿ãã¯ã®æ¡åŒµè¡šç€ºã®æ©èœãç¡å¹ã«ããæšæºé¢æ°var_dumpïŒïŒããªãŒããŒã©ã€ãããŸãã ããã¯éçºãæ¯æŽãããã°ãããæ©èœã§ããã«ããããããããµã€ãã³ãŒãã®åäœãïŒãããã§ã¯ãããŸããïŒå€æŽããŸãã ç§ãã¡ã¯ããã«è¡ãããšãã§ããŸããã
åæã®éå§ïŒé¢æ°åŒã³åºãã®ãã¬ãŒã¹
ãµã€ãã蚺æããŠåé¡é åãèå¥ããããã®æãéèŠã§äŸ¿å©ãªæ¹æ³ã¯ãé¢æ°åŒã³åºãããã¬ãŒã¹ããããšã§ãã éžæãããµã€ãã®ããŒãžã«ç§»åãããšãæ©èœã®æäœã«é¢ããçµ±èšãåéãããŸãã
- ã³ãŒãã®éå§æéãšçµäºæé
- æ©èœé åº
- åé¢æ°å®è¡æé
- åæ©èœã«ããã¡ã¢ãªæ¶è²»
ãã®è²Žéãªæ å ±ã¯ãã³ãŒãã®ããã¬ãŒããã»ã¯ã·ã§ã³ã確å®ã«æ±ºå®ããã®ã«åœ¹ç«ã¡ãŸãã ããã«ãç¹å®ã®æ©èœã«ãã£ãŠæ¶è²»ãããã¡ã¢ãªã®éãå€æããããšãå¯èœã§ãã
ãã¬ãŒã¹ãéå§ããåã«ãæ å ±ã®åéãå¶åŸ¡ããã³ãŒãå®è¡ã®ããã»ã¹ã§ããå¿ èŠãªããŒã¿ãåéããã®ã«åœ¹ç«ã€ããã€ãã®å€æ°ãå®çŸ©ããŸãã
xdebug.collect_paramsã¯ãé¢æ°ã®åŒæ°ã«é¢ããæ å ±ãåéããããã«å¿ èŠãªè©³çŽ°ã瀺ããŸãã 0-æå°ãæ å ±ã¯åéãããŸããã 1-åŒæ°ã®æ°ãšã¿ã€ãã«é¢ããæ å ±ãåéãããŸãã 3-åŒæ°ã®æå³ã«é¢ããæ å ±ã 4-å®å šãªæ å ±ïŒè»¢éæã®ã¿ã€ããååãåŒæ°å€ã å¿ èŠãªæ å ±ãå€ãã»ã©ããã¬ãŒã¹ã«æéãããããŸãã
xdebug.show_mem_deltaã¯ãåé¢æ°ãåŒã³åºããããšãã«ãæçµã¬ããŒãã«ã¡ã¢ãªæ¶è²»éã®éããåæ ãããã©ããã決å®ããŸãã
xdebug.trace_enable_triggerã¯ããªã³ããã³ãã§ãã¬ãŒã¹ãéå§ããæ©èœãæå¹ãŸãã¯ç¡å¹ã«ããŸãã
xdebug.auto_traceã¯ããµã€ãã®ããŒãžã«ã¢ã¯ã»ã¹ãããã³ã«ãã¬ãŒã¹ã®èªåéå§ãæå¹ãŸãã¯ç¡å¹ã«ããŸãã
xdebug.collect_assignmentsã«ã¯ãã¬ããŒãã«å€æ°ã®å²ãåœãŠæ å ±ãå«ãŸãããå«ãŸããŸããã
xdebug.collect_includesã¯ãã¬ããŒãã«æ¥ç¶ãã¡ã€ã«ã«é¢ããæ å ±ãå«ãããå«ããŸããã
xdebug.collect_returnã¯ãé¢æ°ã«ãã£ãŠè¿ãããå€ã«é¢ããæ å ±ãã¬ããŒãã«å«ãããå«ããŸããã
xdebug.trace_output_dirã¯ãã¬ããŒããã¹ããŒããããã£ã¬ã¯ããªãæå®ããŸãã
xdebug.trace_output_nameã¯ãã¬ããŒãã®ãã¡ã€ã«åãçæããŸãã
æ®ãã®å€æ°ã¯ã¬ããŒãã®èŠèŠè¡šç€ºã«é¢é£ä»ããããŠãããèå³ã¯ãããŸããã æšæºåœ¢åŒã¯ãåæã«ã¯ãŸã£ããåãå ¥ããããããã§ãã
ãã®æ¹æ³ã®æ¬è³ªã¯ã管çè ãåžæããæç¹ã§ã®ã¿ãã¬ãŒã¹ãéå§ããããšã§ãã ç¶ç¶çã«ãã¬ãŒã¹ãæå¹ã«ãããšãã³ãŒãå®è¡äžã®ãªãœãŒã¹æ¶è²»ãå¢å ããäžå¿ èŠãªã¬ããŒãã倧éã«äœæããããããåãå ¥ããããŸããã 管çè ãèŠæ±ã®å®è¡æã«ãã¬ãŒã¹æ©èœãéå§ããããšããµãŒããŒã«ç€ºãã«ã¯ãGETãŸãã¯POSTèŠæ±ã§XDEBUG_TRACEãã©ã¡ãŒã¿ãŒãæž¡ããããã®ååã®Cookieãèšå®ããå¿ èŠããããŸãã åŸè ã®æ¹æ³ã¯ãPOSTèŠæ±ãéä¿¡ããããšãåžžã«å¯èœã§ãããšã¯éãããã»ãšãã©å¿ èŠãªããããæã奜ãŸããããã§ãã ãŸããGETã䜿çšããå ŽåãPHPã³ãŒããåŒã³åºãåã«mod_rewriteãŸãã¯ãšã€ãªã¢ã¹ã䜿çšããŠãµãŒããŒã§ã¢ãã¬ã¹ããŒãåŠçãããããšãå€ããšããäºå®ã«é¢é£ããåé¡ãçºçããå¯èœæ§ããããŸãã ãããã£ãŠãå€æ°ã¯åã«å®å ã«å°éããªãå¯èœæ§ããããŸãã
転éãããå€æ°ãæ¥ç¶ããããã¡ã€ã«ãããã³é¢æ°åŒã³åºãéã®æ¶è²»ã¡ã¢ãªã®å·®ã«é¢ããæ倧æ å ±ãåéããŸãã ã¬ããŒãã¯/ var / tmpã«è¿œå ãããŸãã ä»ã®èšå®ã¯ããã©ã«ãã§ãã ãã®çµæã php.iniã«æ¬¡ã®è¡ãè¿œå ããŸãã
xdebug.trace_enable_trigger = 1
xdebug.auto_trace = 0
xdebug.collect_params = 4
xdebug.show_mem_delta = 1
xdebug.trace_output_dir = / var / tmp
ãããŠãWebãµãŒããŒãåèµ·åããŸãã åæã®ããã«ã次ã®ã³ãŒãã䜿çšããŸãã
<?php require "config.inc"; require "class/db.php"; for ($i = 1; $i < 6; $i++) { show_num($i); } $v = array(); alloc_array(1024); $db = DB::Get("mysql", HOST, USER, PASS, NAME); $db->connect(); echo "finished"; function show_num($i) { ($i % 2) ? show_odd($i) : show_even($i); } function show_odd($i) { echo "odd: $i<br>"; } function show_even($i) { echo "even: $i<br>"; sleep(1); } function alloc_array($size) { global $v; for ($i = 0; $i < $size; $i++) { $v[] = $i; } } ?>
ã³ãŒãã¯ãã¹ãã±ãŒã¹ä»¥å€ã®å Žåã«äœ¿çšãã䟡å€ããªããšæšæž¬ããã®ã¯ç°¡åã§ããããŠãŒã¶ãŒããã©ãŠã¶ãŒã§ãã®ã³ãŒããæ åœããããŒãžãéãããšãããšããŸãããã ããŒãžã¯10ç§ä»¥äžããŒããããŠããŸããããã¯éåžžã«é·ãæéã§ãã ã³ãŒããã¬ãŒã¹ã¯æ¢ã«ããã«å¿ããŠæ§æãããŠããããããµãŒããŒã«ä»åŸã®èŠæ±ã«å¯ŸããŠæå¹ã«ãããã®èŠæ±ãè¡ãããã«æ瀺ããããšããã§ããŸããã åè¿°ããããã«ããã®ããã«ã¯ãGETãŸãã¯POSTãªã¯ãšã¹ãã§XDEBUG_TRACEå€æ°ãèšå®ããããCookieã䜿çšããŠæž¡ãå¿ èŠããããŸãã æåŸã®ãªãã·ã§ã³-Cookie転éãéžæããŸããã
éåžžãç¹å®ã®ãã¡ã€ã³ã®Cookieå€æ°ã¯ãHTTP Set-CookieããããŒãéä¿¡ããŠã¯ã©ã€ã¢ã³ãã®ãã©ãŠã¶ãŒã®ãµãŒããŒã«ãã£ãŠèšå®ãããããJavaScriptã䜿çšããŠã¯ã©ã€ã¢ã³ãåŽã§æ¢ã«èšå®ãããŠããŸãã
ãµãŒããŒããå¿ èŠãªããããŒãååŸããã®ã¯éåžžã«å°é£ã§ãããµã€ãã³ãŒãã«ã¯è§ŠããããµãŒããŒèšå®ãå€æŽããã«ã¯åèµ·åãå¿ èŠã§ããããã¯å®æçãªïŒ1åéãã®ïŒæäœã§ã¯åãå ¥ããããŸããã æãæ£ãããªãã·ã§ã³ã¯ãïŒã¯ã©ã€ã¢ã³ãïŒåŽã§ãã¡ã€ã³ã®Cookieãèšå®ããããšã§ãã Cookieã®èšå®ã«å¿ èŠãªJavaScriptããµãŒããŒã«åŒ·å¶çã«æäŸããããšã¯ã§ããŸããã Set-CookieããããŒã®å Žåãšåãçç±ã§ãã¹ãŠã ãããã£ãŠãç§ãã¡ã¯èªåã§ãã©ãŠã¶ã«ã¯ãããŒãèšå®ããŸãã Google Chromeã§ã¯ãã¢ãã¬ã¹ããŒã«ã¹ã¯ãªãããçŽæ¥å ¥åããããšã§ãããå®è¡ã§ããŸãã
javascriptïŒdocument.cookie = "XDEBUG_TRACE = 1"
ãã®ã¹ã¯ãªããã®å®è¡ã³ã³ããã¹ãã¯ããµã€ãã«é©ããŠããå¿ èŠããããŸãã ã€ãŸããæåã«ãµã€ãããŒãžãéããŠãããã³ãã³ããå ¥åããå¿ èŠããããŸãã
å€æ°ãèšå®ããããããŒãžã«ãªã¯ãšã¹ããäœæãããªã¯ãšã¹ãã®çµäºãåŸ ã¡ãŸãã 次ã«ããµãŒããŒã§ã / var / tmpãã£ã¬ã¯ããªã§å¯Ÿå¿ãããã¬ãŒã¹ãã¡ã€ã«ãæ¢ããŸãã çµæãèŠãŠãã ããïŒ
ãã¬ãŒã¹éå§[2012-09-25 11:19:54] 0.0005 645152 +645152-> {main}ïŒïŒ/var/www/test.phpPoint 0.0007 649296 +4144-> requireïŒ/var/www/config.incïŒ/var/www/test.php:4 0.0007 649504 +208-> defineïŒ 'HOST'ã'10 .1.1.1 'ïŒ/var/www/config.inchaps 0.0008 649536 +32-> defineïŒ 'NAME'ã 'db'ïŒ/var/www/config.inc:4 0.0008 649568 +32-> defineïŒ 'USER'ã 'u0'ïŒ/var/www/config.inchaps 0.0008 649600 +32-> defineïŒ 'PASS'ã 'ps'ïŒ/var/www/config.inc:6 0.0012 695728 +46128-> requireïŒ/var/www/class/db.phpïŒ/var/www/test.phphaps 0.0013 694736 -992-> show_numïŒ$ i = 1ïŒ/var/www/test.php:8 0.0013 694736 +0-> show_oddïŒ$ i = 1ïŒ/var/www/test.php:21 0.0013 694864 +128-> show_numïŒ$ i = 2ïŒ/var/www/test.php:8 0.0013 694864 +0-> show_evenïŒ$ i = 2ïŒ/var/www/test.php:21 0.0014 694960 +96-> sleepïŒ1ïŒ/var/www/test.php:30 1.0033 694864 -96-> show_numïŒ$ i = 3ïŒ/var/www/test.php:8 1.0034 694864 +0-> show_oddïŒ$ i = 3ïŒ/var/www/test.php:21 1.0034 694864 +0-> show_numïŒ$ i = 4ïŒ/var/www/test.php:8 1.0034 694864 +0-> show_evenïŒ$ i = 4ïŒ/var/www/test.php:21 1.0035 694960 +96-> sleepïŒ1ïŒ/var/www/test.php:30 2.0047 694864 -96-> show_numïŒ$ i = 5ïŒ/var/www/test.php:8 2.0048 694864 +0-> show_oddïŒ$ i = 5ïŒ/var/www/test.php:21 2.0048 695224 +360-> alloc_arrayïŒ$ãµã€ãº= 1024ïŒ/var/www/test.php:13 2.0057 843024 +147800-> DB :: GetïŒ$ type = 'mysql'ã$ host = '10 .1.1.1 'ã$ user =' u0 'ã$ pass =' ps 'ã$ db =' db 'ïŒ/ var /www/test.php:15 2.0057 843664 +640-> absDB-> __ã³ã³ã¹ãã©ã¯ãïŒ$ host = '10 .1.1.1 'ã$ user =' u0 'ã$ pass =' ps 'ã$ db =' db 'ïŒ/ var / www / class / db phpïŒ10 2.0058 843664 +0-> DB-> __ã³ã³ã¹ãã©ã¯ãïŒ$ host = '10 .1.1.1 'ã$ user =' u0 'ã$ pass =' ps 'ã$ db =' db 'ïŒ/ var / www / class / db phpïŒ36 2.0058 844000 +336-> DB-> buildïŒïŒ/var/www/class/db.php:19 2.0058 844016 +16-> absDB-> connectïŒïŒ/var/www/test.php:16 2.0058 844368 +352-> mysqli_connectïŒ'10 .1.1.1 'ã' u0 'ã' ps 'ã' db 'ïŒ/var/www/class/db.php:47 11.0164 8432 ãã¬ãŒã¹çµäº[2012-09-25 11:20:05]
ã¬ããŒãã®æåã®è¡ãšæåŸã®è¡ã¯ããããããªã¯ãšã¹ãã®éå§æéãšçµäºæéã瀺ããŠããŸãã ãã®æ å ±ãããã³ãŒãã11ç§éå®è¡ãããããšãããããŸãã ãŸããã¬ããŒãã«ã¯ããã¹ããèæ ®ããŠãã³ãŒãå ã®ãã¹ãŠã®é¢æ°ã®åŒã³åºãé åºã衚瀺ãããŸãã æåã®åã¯ãé¢æ°ãåŒã³åºããããšãã®åèšã³ãŒãå®è¡æéãç§åäœã§ç€ºãã2çªç®ã®åã¯ãé¢æ°ãåŒã³åºããããšãã®ã¡ã¢ãªæ¶è²»éããã€ãåäœã§ç€ºããŸãã 3çªç®ã®åã¯ãåã®é¢æ°ã«ãã£ãŠåŒãèµ·ããããã¡ã¢ãªæ¶è²»éã®éãã§ãã æ®ãã®åã«ã¯ãé¢æ°åããã¡ã€ã«åãããã³é¢æ°ãåŒã³åºãããè¡çªå·ã衚瀺ãããŸãã
ã³ãŒãã®å®è¡é床ãé ããªãåå ãç解ããŠã¿ãŸãããã ãŸã第äžã«ãã»ãŒ9ç§ãããmysqli_connectïŒïŒé¢æ°ã®é·ãäœæ¥ãå°è±¡çã§ãã æããã«ããªã¢ãŒããµãŒããŒãžã®ã¢ã¯ã»ã¹ã«åé¡ããããŸãã ãã®é¢æ°ã¯ãæœè±¡åãšã¯ã©ã¹ã®ããã€ãã®å±€ãéããŠåŒã³åºãããããšã«æ³šæããŠãã ããã å€ãã®ãã¬ãŒã ã¯ãŒã¯ã§ã¯ãããã¯äžè¬çãªããšã§ãã ããã«ããŠãŒã¶ãŒå®çŸ©ã®show_evenïŒïŒé¢æ°ã§åŒã³åºãããsleepïŒïŒé¢æ°ã§é 延ãçºçããŸãã
ã¡ã¢ãªæ¶è²»ã«é¢ããŠã¯ããŠãŒã¶ãŒå®çŸ©é¢æ°alloc_arrayïŒïŒãåŒã³åºããåŸã«140KB以äžã®æ¥æ¿ãªãžã£ã³ããèŠãããŸãããŸããã³ãŒãå®è¡ã®æåã«å€§éã®ã¡ã¢ãªãå²ãåœãŠãããŸãã
éçºè ããããã®ã¬ããŒãããœãŒã¹ã³ãŒããšæ¯èŒã§ããããã«ããã¹ãŠã®é¢æ°ã«æž¡ãããåŒæ°ã«é¢ããå¿ èŠãªæ å ±ããã¹ãŠè¡šç€ºãããŸãã
ã³ãŒããããã¡ã€ãªã³ã°
xdebugãã³ãŒãã®ããã«ããã¯ãèŠã€ããããã«æäŸãããµãŒããŒç®¡çè ããµã€ãã³ãŒããå€æŽããã«äœ¿çšã§ããå¥ã®æ©äŒã«èšåãã䟡å€ããããŸãã ããã¯ãããã¡ã€ãªã³ã°ã§ãã ãããã¡ã€ãªã³ã°ã¯ãCookieå€æ°ã®ååãé€ããŠãé¢æ°ãã¬ãŒã¹ã®éå§ãšåãæ¹æ³ã§éå§ããŸãã XDEBUG_TRACEã®ä»£ããã«ãXDEBUG_PROFILEã䜿çšãããŸãã ãããã¡ã€ãªã³ã°ã®çµæã vallgrindã®callgrind_annotateãŠãŒãã£ãªãã£ã§èªèã§ããããŒã¿ãå«ããã¡ã€ã«ãååŸããKDEã®KCacheGrindãŠãŒãã£ãªãã£ãŸãã¯Windowsã®WinCacheGrindã䜿çšããŠã°ã©ãã£ã«ã«ã«è¡šç€ºããããšãã§ããŸãã äžã§ãKCacheGrindã¯æãæ©èœãè±å¯ã§ãã
ãªã³ããã³ãã®ãããã¡ã€ãªã³ã°ã¯ãé¢æ°ãã¬ãŒã¹ãã£ã¬ã¯ãã£ãã«é¡äŒŒãããã£ã¬ã¯ãã£ãã䜿çšããŠæ§æã§ããŸãã
xdebug.profiler_enable = 0
xdebug.profiler_enable_trigger = 1
xdebug.profiler_output_dir = / var / tmp