Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ϸϸƷζPHP³ÌÐòµÄËã·¨

http://prato.bokele.com/?ArticleID=15302
    ÔÚÒ»°ãµÄÓ¦ÓÃÖУ¬PHPµÄ³ÌÐòÔ±»á±È½ÏÉÙµÄ×¢Òâµ½php³ÌÐòµÄϸ΢Ëã·¨¶ÔÐÔÄÜÓ°ÏìµÄÎÊÌ⣬µ«ÔÚ´¦ÀíһЩ±È½ÏÕ¼ÓÃ×ÊÔ´µÄ¶«Î÷µÄʱºò£¬Êʵ±µ÷ÕûËã·¨£¬»áÈóÌÐòµÄÐÔÄÜÕû±¶µÄÌá¸ß¡£
    Õ⼸Ì죬ÎÒÔÚÑо¿·Ö´ÊµÄËã·¨£¬Èç¹û²»Ô¤ÏÈÔØÈë´ÊµäµÄ»°£¬ÄÇÖÖÔËËãËٶȼòÖ±²Ò²»È̶ã¬Òò´ËÎÒ¿¼ÂÇÁËÔ¤ÏÈÔØÈë´ÊµäÔÚÒ»¸öÊý×éÖеÄ×ö·¨£¬ÎÒÊÖÉÏÓÐÒ»¸öÊ®¶àÍò´Ê»ãµÄ´Êµä£¬¿ªÊ¼µÄʱºò£¬ÓÃÕâÑùµÄ·½Ê½ÔØÈ룺
$fp = fopen(dirname(__FILE__)."/mydic.txt","r");
while($wd = fgets($fp,1024)){
 $ws = split("`",trim($wd));
 $m_dic[$ws[0]][$ws[1]] = $ws[2];
}
fclose($fp);
ÕâÑùÒ»²âÊÔ£¬·¢ÏÖ·ÖÎöʱºòÂýÍÌÍ̵ģ¬ºóÀ´Í¨¹ý¼ì²âÖ´ÐÐʱ¼ä²Å·¢ÏÖ£¬Ô­À´ÔØÈë´Êµä¾ÓÈ»ÓÃÁË 1.5 Ãë¶à£¬Ò²Äѹ֣¡
Êý¾Ý¸ñʽΪ£º
0ÁУºÇ°Á½´ÊµÄÆ´Òô£¬1ÁÐΪ£º´Ê£¬2ÁÐΪ£º´ÊµÄ³¤¶È
È磺
al`°ÂÁÖÆ¥¿ËÔ˶¯»á`14
al`°¢À­²®µÄÀÍÂ×˹`14
as`°£Èû¶í±ÈÑǸßÔ­`14
wp`ÍúÆÌ×âÊÛ`8  
wq`ÍøÇòÍõ×Ó`8  
wq`ÍâÆó·þÎñ`8
ÎÒÊÔһϲ»×÷ÈÎÔË×÷Ë㣬ֻ¶ÁÒ»±éÊý¾ÝÎļþ£º
$fp = fopen(dirname(__FILE__)."/mydic.txt","r");
while($wd = fgets($fp,24)){
 //$ws = split("`",trim($wd));
 //$m_dic[$ws[0]][$ws[1]] = $ws[2];
}
fclose($fp);
¾­²âÊÔÖ»ÓÃÁË£º0.18 Ã룬ÏÔÈ»ÕæÕýÕ¼ÓÃʱ¼äµÄ´úÂëÊÇ£º
$ws = split("`",trim($wd));
$m_dic[$ws[0]][$ws[1]] = $ws[2];
ÕâÁ½ÐдúÂ룬ÎÒ°ÑËü»»³ÉÕâ¸öÑù×Ó£º
$fp = fopen(dirname(__FILE__)."/mydic.txt","r");
while($wd = fgets($fp,24)){
 $WordEnd = strpos($wd,"`",3);
 $m_dic[$wd[0].$wd[1]][substr($wd,3,$WordEnd-3)] = ($WordEnd-3)*2;
}
fclose($fp);
ÕâÑù²âÊÔ¾ÍÖ»ÓÐ 0.7 Ãë¶à£¬È»ºó°Ñ´ÊµäÖдʵij¤¶ÈÈ¥³ý£¬±äΪ£º
$fp = fopen(dirname(__FILE__)."/mydic.txt","r");
while($wd = fgets($fp,18)){
 $WordEnd = strlen($wd)-2;// 2ÊÇ" "µÄ³¤¶È
 $m_dic[$wd[0].$wd[1]][substr($wd,3,$WordEnd-3)] = ($WordEnd-3)*2;
}
fclose($fp);
ÓÖ¿ìÁË 0.07 Ãë×óÓÒ£¬ËÙ¶ÈÔÚ 0.63 ÃëÖÐÅÇ»²£¬ÕâºÍÔ­À´µÄ 1.5 ÊǶà´óµÄ²î±ðѽ£¡


Ïà¹ØÎĵµ£º

PHPÖ®¸¸£º¿ª·ÅºÍ»¥¶¯ÊÇÍøÕ¾³É¹¦µÄ»ù´¡


PHPÖ®¸¸Rasmus LerdorfÔÚ»¥ÁªÍø¼¼Êõ¾«Ó¢ÂÛ̳Éϱíʾ£¬¿ª·¢ºÍ»¥¶¯ÊÇÍøÕ¾³É¹¦µÄ»ù´¡¡£
¡¡¡¡RasmusÒÔÑÇÂíÑ·ºÍÑÅ»¢¾ÙÀý£¬“ÕâЩÍøÕ¾Èç¹ûûÓÐÓû§µÄ»°£¬×öµÃÔÙƯÁÁҲʲô¶¼²»ÊÇ”¡£RasmusÈÏΪ£¬ÍøÕ¾Ò»¿ªÊ¼Ó뱨ֽһÑù£¬½ö½öÊÇ“µ¥Ïò½»Á÷”ÌṩÐÅÏ¢£¬ÓÐÈËÀ´¿´¼´¿É¡£
¡¡¡¡“µ«ÊǶÔÏÖ´úµÄÍøÕ¾À´Ëµ£¬ÕâÒÑ ......

ʹÓÃphpize½¨Á¢phpÀ©Õ¹

½ñÌìÒª½²µÄÊÇlinuxÏÂphpÀ©Õ¹µÄÈëÃÅƪ
¡¡¡¡ÏÂÃæÎÒÀ´½²½²ÈçºÎ×÷Ò»¸öphpµÄÀ©Õ¹
¡¡¡¡Ê×ÏÈÒªÓÐÒ»¸ö´î½¨ºÃµÄphp»·¾³
¡¡¡¡ÎÒ°ÑphpµÄ°²×°ÔÚÁË/usr/local/phpµ±È»Ò²Í¨¹ý
¡¡¡¡phpµÄÒ»¸öÅäÖÃphp.iniµÄ·¾¶µ«ÊÇҪעÒâÁË
¡¡¡¡ÓÃÕâÖÖ·½·¨°²×°µÄphpÀ©Õ¹²»ÄÜʵÏÖ
¡¡¡¡ÎÒÃÇÔÚphp°²×°ÒÔºóµÄ/usr/local/php/binĿ¼
¡¡¡¡ÕÒµ½Õâ¸öÎļþphp ......

php³ÌÐòÌáËÙÔ­Àí·ÖÎö

Ô­Ìù:http://www.paitoubing.cn/blog/tag/apc
php³ÌÐòÌáËÙÔ­Àí·ÖÎö
2008Äê7ÔÂ19ÈÕ
ûÓÐÆÀÂÛ


¹Ø¼ü´Ê£ºxCache,Zend Accelerator,memcahced,xdebug£¬Zend Optimizer,APC.
»º³å²ã¼¶±ðµÄÓÅ»¯
xCacheÊÇ°Ñ PHP ²Ù×÷Â뻺´æµ½ÄÚ´æÖÐµÄ PHP À©Õ¹ÖУ¬XCache ½«±ÜÃâ´ú¼Û¸ß°ºÇÒ²»±ØÒªµÄ»¨·ÑÀ´ÖØбàÒëÏ ......

PHP¼¼ÇÉ£ºÊ¹ÓÃAPC»º´æÓÅ»¯PHP³ÌÐò

Ô­Ìù£ºhttp://www.itlearner.com/article/2009/4343.shtml
Alternative PHP Cache£¨APC£©ÊÇ PHP µÄÒ»¸öÃâ·Ñ
¹«¿ªµÄÓÅ»¯´úÂ뻺´æ¡£ËüÓÃÀ´ÌṩÃâ·Ñ£¬¹«¿ª²¢ÇÒÇ¿½¡µÄ¼Ü¹¹À´»º´æºÍÓÅ»¯ PHP µÄÖмä´úÂë¡£
ÔÚ Windows Ï£¬APC ÒªÇóÓÐ c:\tmp Ŀ¼£¬²¢ÇÒ¸ÃĿ¼Ҫ¶Ô Web ·þÎñÆ÷½ø³Ì¿Éд¡£
1¡¢°²×°
ÒÔPHP extension ÐÎʽ°²×°
2 ......

Óà PHP ¶ÁÈ¡ÎļþµÄÕýÈ··½·¨


 
Á˽âÈçºÎʹÓà PHP µÄ¸÷ÖÖÎļþº¯Êý¡£²é¿´ÖîÈç fopen¡¢fclose ºÍ feof Ö®ÀàµÄ»ù±¾Îļþº¯Êý£»Á˽âÖîÈç fgets¡¢fgetss ºÍ fscanf Ö®ÀàµÄ¶ÁÈ¡º¯Êý¡£²¢ÇÒ·¢ÏÖÓÃÒ»Á½ÐдúÂë´¦ÀíÕû¸öÎļþµÄº¯Êý¡£
ÈÃÎÒÃÇËãÒ»ËãÓжàÉÙÖÖ·½·¨
´¦ÀíÖîÈç PHP Ö®ÀàµÄÏÖ´ú±à³ÌÓïÑÔµÄÀÖȤ֮һ¾ÍÊÇÓдóÁ¿µÄÑ¡Ïî¿ÉÓá£PHP ¿ÉÒÔÇáËɵØÓ®µÃ Perl µÄ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ