ProfilingÊÇÒ»ÏiÓÃÀ´¹Û²i³ÌÐoÐÔÄܵļ¼Êo£¬Ç³£ÊÊÓÃÓÚ¢ÏÖ³ÌÐoµÄÆ¿¾±»oÕß½oÕŵÄ×ÊÔ´¡£ProfilingÄܹ»ÉiÈe³ÌÐoµÄÄÚ²¿£¬Õ¹ÏÖrequest´¦Ài¹ý³ÌÖÐÿһ²¿Ö´uÂeµÄÐÔÄÜ£»Í¬Ê±£¬Ò²¿ÉÒÔȶ¨ÓÐÎÊÌaµÄÇeÇo£¨request£(C)£»¶ÔÓÚÓÐÎÊÌaµÄÇeÇo£¬ÎÒÃÇ»¹¿ÉÒÔȶ¨ÐÔÄÜÎÊÌa¢ÉuÔÚÇeÇoÄÚ²¿µÄλÖ᣶ÔÓÚPHP£¬ÎÒÃÇÓжaÖÖProfiling¹¤¾ß£¬±¾ÎÄÖ÷Òª¼¯ÖÐÔÚ¡ª¡ªXHGui£¬Ò»¿idz£ÓÅÐaµÄ¹¤¾ß¡£XHGui¹¹½¨ÔÚXHProfÖ®ÉÏ£¨XHProfÓÉFacebook¢²¼£(C)£¬µ«ÊǶÔÓÚÆÊÎo½a¹uÔo¼ÓÁ˸uºÃµÄ´ae´¢£¬Í¬Ê±Ôo¼ÓÁ˸u¼ÓÁ¼ºÃµÄÐÅÏ¢»ñÈ¡½Ó¿Ú¡£´ÓÕa*½ÃaeÀ´Ëµ£¬XHGui¸uÏñÊÇÒ»¸oÈ«ÐµĹ¤¾ß¡£
XHGuiÒѾ¾Àu¹ý¼¸¸o°ae±¾µÄµu´u£¬µ«µ±Ç°°ae±¾Ìa¹(C)Á˸u¼ÓƯÁÁµÄÓû§½çÃae£¬²¢ÇÒʹÓÃMongoDB´ae´¢ÆaÆÊÎo½a¹u¡£Ïa±ÈÓÚÇ°Ò»°ae±¾À´Ëµ£¬ËuÓÐÕaÐ(C)½Ãae¶¼ÊǾ޴oµÄ¸Ä½ø£»ÒoΪ£¬Ç°Ò»°ae±¾¸uÏñÊÇ¿ª¢ÕßÉe¼ÆµÄ£¬²ÉÓÃÎļþÀ´±£´aeÊý¾Ý£¬Ê¹µÃÊÕ¼¯µÄÊý¾Ýdz£ÄÑÒÔʹÓá£XHGui 2013ÊÇÒ»¸odz£È«ÃaeµÄProfiling¹¤¾ß£¬ÎÞÂÛÊǶԹÜÀiÈËÔ±À´Ëµ»¹ÊǶÔÓÚ¿ª¢Õߣ»Óe´Ëͬʱ£¬XHGui 2013±»Ée¼ÆµÄ×a¹»ÇaÇÉÒÔ±aÄܹ»ÔÚÉu²u»¾³ÏÂÔËÐС£
±¾ÎĽ«Ò»²½Ò»²½ÑÝʾ³ÌÐoµÄ°²×°£¬Í¬Ê±ÏoÄaÕ¹ÏÖʹÓøù¤¾ß¿ÉÒÔÊÕ¼¯µÄ¸÷*½ÃaeÐÅÏ¢¡£
µÚÒ»²½£º°²×°ÒÀÀµ
ÒoΪXHGuiÓÐÒ»Ð(C)ÒÀÀµÏi£¬ËuÒÔÎÒÃǵÚÒ»²½¾ÍÊǽa¾oÕa¸oÎÊÌa¡£µ×ϵÄËuÓеĽ̶̳¼ÊÇ»uÓÚUbuntu 13.04ƽ̨µÄ£¬µ±È»£¬ÄaÓ¦¸Ã¿ÉÒÔ°ÑËuÃǸıaϲ¢ÊÊÓõ½µ½Äa×Ô¼ºµÄƽ̨ÉÏ¡£Ä¿Ç°¶øÑÔ£¬ÎÒÃÇÐeÒª°²×°MongoDB£¬ PHP£¬²¢ÓÐÒ»Ð(C)°²×°PECLÍØÕ¹µÄÄÜÁ¦¡£
Ê×ÏÈ£¬ÎÒÃÇÒª°²×°MongoDB£¬Õa±ßÓÐÒ»Ð(C)¹Ù*½µÄ°²×°½Ì³Ì£¬Äa¿ÉÒÔÕÒµ½ºÍÄaϵͳÏa¹ØµÄϸ½Ú£¬µ«ÊÇÏÖÔÚÎÒ½«Í¨¹ý¼oµ¥µÄͨ¹ýAPTÀ´°²×°£º
aptitude install mongodb
ͨ¹ýÕa¸o½Ê½»ñÈ¡µÄMongoDBµÄ°ae±¾¿ÉÄܲ»ÊÇ×iеģ¬ÒoΪÕa¸o²uƵĸuÐÂËÙ¶ÈÕaeµÄºÜ¿i¡£µ«ÊÇ£¬Èç¹uÄaÏeÈÃËu±£³ÖÒ»¸oºÜеİae±¾£¬Äa¿ÉÒÔ°ÑMongoDBÌa¹(C)µÄ¿aÌi¼Óµ½ÄaµÄ°u¹ÜÀiÆ÷Ài£¬ÕaÑuÄa¾ÍÄܵõ½Ò»¸o×iеÄÁË¡£
Óe´Ëͬʱ£¬ÎÒÃÇ»¹ÐeÒªÕe¶ÔPHPµÄMongo Çý¶¯¡£ÔÚ²Ö¿aÖиÃÇý¶¯µÄ°ae±¾ÓеaÀÏ£¬ÎªÁ˽ñÌiµÄÑÝʾ£¬ÎÒÃǽ«´ÓPeclÖнøÐлñÈ¡¡£Èç¹uÄaµÄ»uÆ÷ÉÏûÓÐpeclÃuÁi£¬Äa¿ÉÒÔͨ¹ýÏÂÃaeµÄÃuÁi½øÐа²×°£º
aptitude install php-pear
È»ºo£¬ÎÒÃÇͨ¹ýÏÂÃaeµÄÃuÁiÏoPHPÌi¼ÓMongoDBµÄÇý¶¯³ÌÐo£º
pecl install mongo
ΪÁËÍe³É°²×°£¬×iºoÎÒÃÇÐeÒªÔÚphp.iniÎļþÖÐÐÂÔo¼ÓÒ»ÐС£µ«ÊÇ£¬Ð°ae±¾µÄUbuntuΪÅaÖÃPHPÀ(C)Õ¹Ìa¹(C)ÁËÒ»¸oÐÂϵͳ£¬¸Ãϵͳ¸uÏñApacheÄ£¿e°²×°¡ª¡ª½«ËuÓеÄÅaÖñ£´aeÔÚÒ»¸oµØ½£¬È»ºo´´½¨Ò»¸ouºÅÁ´½ÓÒÔÆo¶¯ÅaÖá£Ê×ÏÈ£¬ÎÒÃÇ´´½¨Ò»¸oÎļþÀ´±£´aeÉeÖ㬾¡¹ÜÔÚ±¾Ê¾ÀýÖнoÐeÒªÔÚÉeÖÃÖÐÐÂÔoÒ»ÐÐÒÔÆo¶¯À(C)Õ¹¡£ÎÒÃǽ«Æa±£´aeÔÚÎļþ/etc/php5/mods-available/mongo.ini£¬ÐÂÔoÏÂÃaeÒ»ÐÐ:
php5enmod mongo
ÔÙ´ÎʹÓÃpeclÀ´°²×°xhprofÀ(C)Õ¹³ÌÐo¡£¸Ã³ÌÐoÄ¿Ç°½oÊÇbeta°ae±¾£¬Òo´Ë°²×°ÃuÁiÈçÏ£º
pecl install xhprof-beta
ÃuÁiÐлaÔÙÒ»´ÎÌaʾÎÒÃÇÔÚphp.iniÐÂÔoÒ»ÐС£ÎÒÃDzÉÓÃÓeÉÏÃaeÒ»ÑuµÄ½¨£¬´´½¨Îļþ/etc/php5/mods-available/xhprof.ini£¬²¢ÔÚÀiÃaeÐÂÔoÈçÏÂÄÚÈ磺
extension=xhprof.so
´Ëʱ£¬ÎÒÃÇ¿ÉÒÔ¼i²eÒ»ÏÂÕaÐ(C)Ä£¿eÊÇñÕýÈ°²×°¡ª¡ªÍ¨¹ýÔÚÃuÁiÐÐÔËÐÐphp -mÃuÁi¡£¼Çס£¬²»ÒªÍu¼ÇÖØÆoApache£¬ÒÔ±aweb½Ó¿ÚÄܹ»ÆoÓÃÕaÐ(C)À(C)Õ¹¡£
°²×°XHGui
XHGui±¾ÉiÖ÷ÒªÓÉwebÒ³Ãae×e³É£¬ËuΪXHProfÀ(C)Õ¹ÊÕ¼¯µÄÊý¾ÝÌa¹(C)¸u¼ÓÓѺõĽçÃae¡£Äa¿ÉÒÔ´Ó´uÂe¿aGitHub repo¿Ë¡£»Ò²¿ÉÒÔÖ±½ÓÏÂÔØzipÎļþ£¬È»ºo½øÐнaѹËo¡£»ñÈ¡³ÌÐoÖ®ºo£¬È¶¨»º´aeĿ¼ÓÐ×a¹»µÄȨÏÞÒÔ±awebþÎñÆ÷ÓÐȨÏÞдÈeÎļþ¡£×iºo£¬ÔËÐа²×°½Å±¾£º
php install.php
Õa¾ÍÊdzÌÐo°²×°ËuÐeµÄÒ»ÇУ¬²¢ÇÒ»a×Ô¶¯°²×°Ò»Ð(C)ÒÀÀµ³ÌÐo£»Èç¹u*¢ÉuÒi³££¬°²×°³ÌÐoÒ²»a¸øÄaÌaʾ¡£
ÎÒ¸uϲ»¶½«XHGui°²×°ÔÚÐeÄaÖ÷»uµ±ÖУ»ÕaÐeÒª.htaccessÎļþÔÊÐi£¬Ò²ÐeÒªÆo¶¯RULÖØд¡£Æo¶¯URLÖØд±iÃ÷ÐeÒªÆo¶¯mod_rewriteÄ£¿e£¬Í¨¹ýÏÂÃaeµÄÃuÁi£º
a2enmod rewrite
£¨²»ÒªÍu¼ÇÖØÆoApache£(C)¡£Èç¹uÒ»ÇÐ˳Àu£¬Äa¿ÉÒÔÕý³£*ÃÎÊXHGuiµÄURL²¢ÇÒ¿ÉÒÔ¿´µ½ÈçÏÂÄÚÈÝ£º
ÔÚÐeÄaÖ÷»uÖÐÆo¶¯XHGui
´Ëʱ£¬ÎÒÃÇÏ£ÍuÆo¶¯XHGuiÒÔ±a¼iÑeÎÒÃÇÍøÕ¾µÄÐÔÄÜ¡£×¢Òa£¬ÐÔÄܲaÊÔ×iºÃÔÚ½øÐÐÈκÎÓÅ»¯Ö®Ç°Ö´ÐÐÒ»´Î£¬ÒÔ±a¼i²aÓÅ»¯µÄЧ¹u¡£×i¼oµ¥µÄ½¨ÊÇÔÚÐeÄaÖ÷»uÖÐÔo¼Óauto_prepend_fileÉuÃ÷£¬ÈçÏÂͼËuʾ£º
<VirtualHost *:80>
ServerName example.local
DocumentRoot /var/www/example/htdocs/
php_admin_value auto_prepend_file /var/www/xhgui/external/header.php
<Directory /var/www/example/htdocs/>
Options FollowSymLinks Indexes
AllowOverride All
</Directory>
</VirtualHost>
Ò»ÇоÍÐ÷Ö®ºo£¬Äa¿ÉÒÔ¿ªÊ¼ÆÊÎoÍøÕ¾µÄÇeÇo¡£XHGuiÖ»»aÆÊÎoÍøÕ¾ÇeÇoµÄ1%£¬ËuÒÔΪÁËʹXHGui»ñÈ¡ÓÐÒaÒaµÄÊý¾Ý£¬ÄaÐeÒªÈÃXHGuiÔËÐÐÒ»¶Îʱ¼a»oÕßʹÓÃÀaËÆApache BenchµÄ²aÊÔ¹¤¾ßÅuÁ¿Ìa½»Ò»ÅuÇeÇo¡£ÎªÊ²Ã´ÔÚ100¸oÇeÇoµ±ÖÐXHGuiÖ»»aÆÊÎoÒ»¸o£¿ÒoΪXHGuiµÄÉe¼Æ³oÖÔ¾ÍÊÇ×a¹»µÄÇaÇÉÒÔ±aÔÚÉu²u»*¾³ÖÐʹÓã¬Ëu²»Ïe¶Ôÿһ¸oÇeÇo²uÉu¶iÍaµÄ¿ªÏu£¬1%µÄ²ÉÑuÂÊÒѾÄܹ»ÎªÍøÕ¾µÄ×ÜÌaÁ÷Á¿Ìa¹(C)½ÏΪÇaÎuµÄ¸ÅÀÀ¡£
Âu×aÊý¾Ý
ÎÒʹÓòaÊÔÐeÄa»uÔËÐб¾ÎÄËuÓеÄʾÀý£¬²ÉÓÃJoind.in API×÷Ϊ²aÊÔ´uÂe¡£ÎªÁ˲uÉuÒ»Ð(C)Á÷Á¿£¬ÎÒ½«API²aÊÔ°¸ÀýÔËÐÐÁ˼¸±e¡£ÄaÒ²¿ÉÒÔÔÚÒ»¶¨¸ºÔصÄÇe¿oÏÂÊÕ¼¯Êý¾Ý£¬ËuÒÔÄa¿ÉÒÔÔÚѹÁ¦²aÊÔʱʹÓÃXHGui£¬ÄaÉoÖÁ¿ÉÒÔÔÚÉÏÏßÕ¾µaÖÐʹÓÃXHGuiÊÕ¼¯Êý¾Ý£¨ÌýÆðÀ´ºÜe¿ñ£¬µ«ÊÇFacebookÕýʽΪÁË´ËÓ¦Óòſª¢Á˸ù¤¾ß£(C)¡£ÔÚÏoÓ¦ÓâËÍÁËÒ»¶¨µÄÇeÇoÖ®ºo£¬ÖØÐÂÃÎÊXHGui£¬ÏÖÔÚËu¾ÍÒѾ±£´aeÁËÒ»Ð(C)Êý¾Ý£º
¸ÃͼÏoÎÒÃÇչʾÁËXHGuiΪÎÒÃÇ*ÖÎoµÄÿһ¸oÇeÇo£¬×iеÄÇeÇoÅÅÔÚµÚһ룬²¢ÇÒΪÿһ¸oÇeÇoչʾÁËÒ»Ð(C)¶iÍaÐÅÏ¢¡£ÕaÐ(C)ÐÅÏ¢°uÀ¨£º
URL£ºÇeÇoËu*ÃÎʵÄURL
ΪÁË»ñȡÿһ±eÇeÇo£¨"run")¸uΪÏeϸµÄÐÅÏ¢£¬Äa¿ÉÒÔµa»÷ÿһ¸oÇeÇoÄa¸ÐÐËȤµÄÁС£Äa¿ÉÒÔµa»÷URLÒÔ±a»ñÈ¡¸ÃURLËuÓÐÇeÇoµÄÏeϸÐÅÏ¢¡£ÎÞÂÛÄÄÖÖ½¨£¬Äa¶¼¿ÉÒÔ»ñÈ¡¸ÃÇeÇo¸uΪÏeϸµÄÐÅÏ¢£º
ÕaÊÇÒ»¸odz£³¤²¢ÇÒdz£ÏeϸµÄÒ³Ãae£¬ËuÒÔÎÒÒýÓÃÁËÁ½¸o½Øͼ£¨Èç¹uչʾËuÓеÄÐÅÏ¢½«ÐeÒª5¸o½Øͼ£(C)¡£ÉÏÃaeÒ»uͼµÄ×o±ß²¿ÖչʾÁ˸ÃÇeÇoÏa¹ØµÄÒ»Ð(C)ÐÅÏ¢£¬ÒÔ±a°iÖuÄa¸u×ÙÕaÐ(C)ͳ¼ÆÐÅÏ¢ÓeÄÄÐ(C)½ÃaeÓйأ»ÓұߵÄÖ÷Òª²¿ÖչʾÁË×iÏuºÄʱ¼aµÄ¸÷²¿ÖÒÔ¼°ÔÚÇeÇo¹ý³ÌÖÐÿ¸oº¯Êýµ÷ÓÃËuÏuºÄµÄÄÚ´ae¡£ÔÚͼµÄϽÓÐÒ»¸oÖ÷¼uÒÔ±iÃ÷ÿһÀ¸¡£
µÚ¶þuͼչʾÁ˸ÃÇeÇoÿһ¸o×e³É²¿Ö¸uΪÏeϸµÄÐÅÏ¢¡£ÎÒÃÇ¿ÉÒÔ¿´µ½Ã¿Ò»²¿Öµ÷ÓõĴÎÊýÒÔ¼°Ê±¼aÏuºÄ£¬»¹°uÀ¨CPUºÍÄÚ´aeÐÅÏ¢¡£ÎÞÂÛÊÇinclusive»¹ÊÇexclusiveÐÅÏ¢¶¼×oÁËÏeϸµÄչʾ£ºexclusive±iʾ½o½oÊǸý*¨µ÷ÓÃËu²uÉuµÄÏuºÄ£»inclusive²»½o°uÀ¨±¾º¯ÊýËu²uÉuµÄÏuºÄ£¬»¹°uÀ¨±¾º¯Êýµ÷ÓõÄÆaËuº¯ÊýËu²uÉuµÄÏuºÄ¡£
XHGuiÁiÒ»¸oÌØÐÔÊÇ¡°µ÷ÓÃͼ¡±£¨Callgraph)£¬¡°µ÷ÓÃͼ¡±ÒÔÉu¶¯µÄÐeÄa*½Ê½Õ¹Ê¾ÁËʱ¼aÊÇÈçºÎÏuºÄµÄ£º
ÕaºÜºÃµÄչʾÁ˺¯Êýµ÷ÓõIJa´Î¡£×iºÃµÄÒ»µaÊÇ£¬¸ÃͼÊǿɽ»»¥µÄ£¬Äa¿ÉÒÔÍÏקÒÔ¸uºÃµÄ²e¿´Á¬½Ó£»Äa»¹¿ÉÒÔÓÃÊo±e»¬¹ý¡°Ô²»¡±£¨blob)ÒÔ²e¿´¸u¶aµÄÐÅÏ¢¡£µ±ÄaÓeËu½»»¥Ê±£¬Ëu»aºÜºÃÍaeµÄµ¯»ØºÍÒƶ¯£¬Õa²»ÊÇÒ»¸odz£ÖØÒªµÄÌØÐÔµ«È´ÈÃÎҸоo*dz£ºÃÍae¡£
Ài½aÊý¾Ý
ÓµÓдoÁ¿µÄͳ¼ÆÊý¾Ýdz£ÖØÒª£¬µ«ÊÇÄaºÜÄÑÖªµÀ´ÓÄÄÀiÏÂÊÖ¡£¶ÔÓÚÒ»¸oÐÔÄܲ»ÈçÔ¤ÆÚµÄÒ³Ãae²ÉÓÃÈçϲ½Öe£ºÊ×ÏÈ£¬¶Ôÿһ¸oº¯ÊýµÄexclusive CPUʱ¼a½øÐÐÅÅÐo£¬²e¿´×iÏuºÄʱ¼aµÄº¯ÊýÁбi¡£ÖÎoÕaÐ(C)ºÄʱµÄº¯Êýµ÷Óò¢½øÐÐÖع¹ºÍÓÅ»¯¡£
Ò»µ(C)×o³oÁËÐ޸ģ¬ÈÃÆÊÎo¹¤¾ßÔٴμiÑeаae±¾µÄ³ÌÐo£¬²aÊÔÐÔÄܵĸĽø¡£XHGuiÄÚÖÃÁËÍeÃÀµÄ¹¤¾ßÒԱȽÏÁ½´ÎÔËÐУ»µa»÷ÏeϸÐÅÏ¢Ò³ÃaeÓÒÉϽǵġ°Compare this run"°´Å¥¼´¿É¡£¸Ã°´Å¥»aÏoÄaչʾ¸ÃURLÿһ´Î²aÊԵĽa¹u£¬´ÓÖÐÑ¡ÔñÒ»¸oÄaÒª±È½ÏµÄ¶ÔÏo¡£¶ÔÄaÏe±È½ÏµÄ¶ÔÏo£¬µa»÷¡±compare¡°°´Å¥£¬XHGui½«»aתÏo±È½ÏÊÓͼ£¬ÈçÏÂͼËuʾ£º
ͳ¼Æ±i¸ñչʾÁËаaeºÍ¾É°aeͳ¼ÆÐÅÏ¢µÄÖ÷ÒªÇø±ð£¬°uÀ¨Ã¿Ò»¸oÐÅÏ¢¸Ä¶¯µÄʵ¼ÊÊý×ÖÒÔ¼°°Ù*ֱȡ£ÉÏͼÏÔʾ£¬Ð°aeµÄÇeÇoµÈ´ýʱ¼a½o½oΪ¾É°aeµÄ8%¡£Í³¼Æ±i¸ñÏeϸչʾÁËÿһ¸oͳ¼ÆÐÅÏ¢µÄ¸Ä±a£¬ÕaÐ(C)ͳ¼ÆÐÅÏ¢ÎÒÃÇÔÚ¡±ÏeϸÐÅÏ¢¡°Ò³ÃaeÄܹ»¾³£¿´µ½£»Äa¿ÉÒÔ¶ÔÈκÎÒ»ÁнøÐÐÅÅÐoÒÔ±a²eÕÒÄa¸ÐÐËȤµÄÐÅÏ¢¡£
Ò»µ(C)ÄaÔÚijһ½Ãae³É¹¦µÄ½øÐÐÁËÖع¹£¬²e¿´ÏeϸÐÅÏ¢Ò³Ãae£¨detail page)ÒÔ¼i²eаae±¾µÄʵ¼ÊЧ¹u£¬È»ºoÌoÑ¡ÆaËu½Ãae½øÐÐÓÅ»¯¡£³¢ÊÔ¶ÔÄÚ´aeʹÓûoÕßexclusive wall time ½øÐÐÅÅÐo£¬ÒÔ±aÌoÑ¡Äܹ»×i´oÏÞ¶ÈÌa¸ßÓ¦ÓÃÕuÌaÐÔÄܵĺ¯Êý½øÐÐÓÅ»¯¡£Í¬Ê±£¬²»ÒªÍu¼Ç¼i²eµ÷ÓõĴÎÊý£¬Ò»¸oÖظ´µ÷Óõĺ¯Êý¾¹ýÓÅ»¯Ö®ºoÄܹ»³É±¶µÄÌa¸ß³ÌÐoµÄÐÔÄÜ¡£
×iÓÅ»¯½¨
ÄaºÜÄÑÔÚÁ¿»¯³É¹u֮ǰ֪µÀ×Ô¼º¸ÄÉÆÁ˶aÉÙ£¬Õa¾ÍÊÇΪʲôÎÒÃǾ³£ÔÚ¶ÔÒ»¸oÓ¦ÓýøÐÐÓÅ»¯Ö®Ç°¼i²aËu--²»È»ÄaÔoô֪µÀ×Ô¼ºÊÇñÕaeµÄÓÅ»¯ÁËËu£¿ÎÒÃÇÒ²ÐeÒªÏeÏeÒ»×eÕaeʵµÄÊý¾ÝÓ¦¸ÃÔoÑu±iʾ£¬²»È»£¬ÎÒÃÇ¿ÉÄÜ»a³¯×ÅÒ»¸o²»¿ÉÄܵ½´iµÄÄ¿±eÇ°½ø¡£Ò»¸oºÜÓÐÓõĽ¨ÊÇ£º¾¡Á¦È¥Ñ°ÕÒÐeҪʹÓõÄ×iÊʺϵÄÊý¾Ý½a¹¹ÒÔ¼°×iС´ae´¢¿Õ¼a¡£Èç¹uÔÚÄaÉó¤µÄ¹¤×÷»¾³ÖУ¬²»ÄÜÔÚ°eÃeÄÚÔËÐÐÒ»¸o¡°Hello world¡±³ÌÐo£¬ÄÇô¾Í±ðÖ¸ÍuÓÃͬÑuµÄ¹¤¾ß¹¹½¨µÄÍøÒ³ÄÜÓжaºÃµÄ±iÏÖ¡£
ÉÏÃaeµÄÐðÊo²¢²»ÊǶԱa³Ì¿o¼Ü£¨framework£(C)µÄ²»¾´£»±a³Ì¿o¼ÜÖ®ËuÒÔ´aeÔÚÊÇÒoΪÆa½±aʹÓá¢Ö§³Ö¿iËÙ¿ª¢¡¢ÈÝÒ×ά»¤¡£Ïa±ÈÇ××ÔÊÖ¹¤±aд´uÂe£¬±a³Ì¿o¼ÜÔÚÐÔÄÜÉϵĽµµÍÊÇÎÒÃÇ×ۺϸ÷½Ãae½øÐÐÕÛÖеĽa¹u¡£²ÉÓña³Ì¿o¼Ü½øÐÐÓ¦Óÿª¢ÊÇÄܹ»¾¡¿iÉÏÏßµÄÒ»ÖֺܺõĽ¨£¬µ±ÐeÒªµÄʱºo£¬Äa¿ÉÒÔʹÓÃProfiling¹¤¾ßÖÎo²¢¸Ä½ø³ÌÐoµÄÐÔÄÜ¡£ÀýÈ磬Zend Framework 1µÄºÜ¶aÄ£¿eÄܹ»Ìa¹(C)ǺÃÇ¿´oµÄÌØÐÔ£¬µ«ÊDz¢ÄÜdz£µÍÏ£»²ÉÓÃProfiling¹¤¾ß¾ÍÄÜȶ¨ÐÔÄܵÍϵIJ¿Ö²¢½«ËuÃǽøÐÐÌae»»¡£ÆaËuËuÓеĿo¼Ü¶¼ÓÐÀaËƵÄÎÊÌa£¬XHGuiÄܹ»ÏoÄuչʾÎÊÌaµÄËuÔÚ²¢¼i²eËuÃÇÊÇñ¶ÔÄaµÄ³ÌÐo²uÉuÁË¿ÉÁ¿»¯µÄÓ°Ïi¡£
ÔÚÄaµÄ³ÌÐoÖ®Ía£¬Ò»Ð(C)ÆaËuµÄ²ßÂÔ¶ÔÕ¼ÁiÉÏ*ç»oÐi³ÙÔçÓÐÓÃ:
µ±ÐÄ*ÇΣÏÕµÄÂýËÙ¹ØÁªº¯Êý£¨not-dangerously-slow-but-related functions£(C)ÔÚÒ»¸oÒ³ÃaeÉ϶Ãae¡£Èç¹uÄaµÄÒ³ÃaeÔÚ¸ñʽ»¯Òªµa´¦ÀiµÄ view helper ÖеÄһϵÁк¯ÊýÖл¨È¥ÁËËuʱ¼aµÄ 50%£¨ÎÒ³ÐŵÕaÊǸo¼ÙÏeµÄÀý×Ó£(C)£¬ÄÇôÄa¿ÉÄÜÏeҪȥÑо¿Öع¹Õu¸o×e¼þ¡£
XHGuiÊÇÄaµÄÅoÓÑ
XHGui°²×°¼oµ¥¡¢Ê¹ÓÃʱÈçÓ°ËaeÐΡ¢ºÜ°oµÄÊa³oÒÔÖÁÓÚ¿ÉÒÔÄõ½¶Ê»aÒeÉϽøÐÐչʾ¡£ËuÄÜʶ±ð³oÎÒÃÇÓ¦ÓÃÖеĴiÎo£¬°iÖuÎÒÃÇÈÈÏÓ¦ÓÃÕaeµÄÆð×÷Ó㨻oÕßûÓУ¡£(C)¡£Õa¿ÉÄÜ»a¾ÀuÒ»Ð(C)Öظ´µÄ¹ý³Ì£¬²»¹ý£¬²»¹ÜÄa֮ǰÓÐûÓÐÓùýXHProf¡¢XHGui£¬ÎÒÈ°Äa»¨µaʱ¼aÔÚÄaµÄÓ¦ÓÃÉÏÊÔÊÔ£¬Äa»a¶ÔÄaµÄ¢ÏÖ´o³ÔÒ»¾ª¡£