<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16525" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=788534709-08102007><FONT face=&#26032;&#32048;&#26126;&#39636; 
color=#0000ff size=2>I just check the code, there are several stuffs will impact 
the performance:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=788534709-08102007><FONT face=&#26032;&#32048;&#26126;&#39636; 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=788534709-08102007><FONT face=&#26032;&#32048;&#26126;&#39636; 
color=#0000ff size=2>1. The order of folders:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=788534709-08102007>&nbsp;&nbsp;&nbsp; <FONT 
face=&#26032;&#32048;&#26126;&#39636; color=#0000ff size=2>- If the file is locate in the last folder, then 
the autload have to check all the folders</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=788534709-08102007><FONT face=&#26032;&#32048;&#26126;&#39636; 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=788534709-08102007><FONT face=&#26032;&#32048;&#26126;&#39636; 
color=#0000ff size=2>2. The number of folders:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=788534709-08102007>&nbsp;&nbsp;&nbsp; <FONT 
face=&#26032;&#32048;&#26126;&#39636; color=#0000ff size=2>-There are about 110 folders in the folder list 
array.&nbsp; I think it is too much folders for autoload</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=788534709-08102007><FONT face=&#26032;&#32048;&#26126;&#39636; 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=788534709-08102007><FONT face=&#26032;&#32048;&#26126;&#39636; 
color=#0000ff size=2>3. The file I/O</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=788534709-08102007><FONT face=&#26032;&#32048;&#26126;&#39636; 
color=#0000ff size=2>&nbsp;&nbsp;&nbsp; - It seems the file I/O under windws is 
much worse then Unix/Linux, that why Oscar feel no big difference with 
autoload.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=788534709-08102007><FONT face=&#26032;&#32048;&#26126;&#39636; 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=788534709-08102007><FONT face=&#26032;&#32048;&#26126;&#39636; 
color=#0000ff size=2>For adapt the new autoload feature in lifetype with such 
big quantity of folders, I think we should try to use the same skill we used in 
script checks.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=788534709-08102007><FONT face=&#26032;&#32048;&#26126;&#39636; 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=788534709-08102007><FONT face=&#26032;&#32048;&#26126;&#39636; 
color=#0000ff size=2>To generate a $include_script[$key] = $value; file for 
autoload.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=788534709-08102007><FONT face=&#26032;&#32048;&#26126;&#39636; 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=788534709-08102007><FONT face=&#26032;&#32048;&#26126;&#39636; 
color=#0000ff size=2>Then we just use array_key_exist to check the $key exist or 
not. Then include the file.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=788534709-08102007><FONT face=&#26032;&#32048;&#26126;&#39636; 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=788534709-08102007><FONT face=&#26032;&#32048;&#26126;&#39636; 
color=#0000ff size=2>It will save a lot of time.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=788534709-08102007></SPAN><SPAN 
class=788534709-08102007><FONT face=&#26032;&#32048;&#26126;&#39636; color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=788534709-08102007><FONT face=&#26032;&#32048;&#26126;&#39636; 
color=#0000ff size=2>Mark</FONT></SPAN></DIV><BR>
<BLOCKQUOTE dir=ltr 
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
  <DIV class=OutlookMessageHeader lang=zh-tw dir=ltr align=left>
  <HR tabIndex=-1>
  <FONT face=Tahoma size=2><B>From:</B> Mark Wu [mailto:markplace@gmail.com] 
  <BR><B>Sent:</B> Monday, October 08, 2007 5:36 PM<BR><B>To:</B> 'LifeType 
  Developer List'<BR><B>Subject:</B> RE: [pLog-svn] __autoload very slow 
  ...<BR></FONT><BR></DIV>
  <DIV></DIV>
  <DIV dir=ltr align=left><FONT face=&#26032;&#32048;&#26126;&#39636; color=#0000ff size=2>
  <DIV dir=ltr align=left><SPAN class=631073309-08102007><FONT face=&#26032;&#32048;&#26126;&#39636; 
  color=#0000ff size=2>I forgot to say this is the result of 
  admin.php?op=newPost</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=631073309-08102007><FONT face=&#26032;&#32048;&#26126;&#39636; 
  color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV dir=ltr align=left><SPAN class=631073309-08102007><FONT face=&#26032;&#32048;&#26126;&#39636; 
  color=#0000ff size=2>You can see there are over 7700 function call of 
  file_exists().</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=631073309-08102007><FONT face=&#26032;&#32048;&#26126;&#39636; 
  color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV dir=ltr align=left><SPAN class=631073309-08102007><FONT face=&#26032;&#32048;&#26126;&#39636; 
  color=#0000ff size=2>If each file_exists call() takes&nbsp;1 ms. It will takes 
  15 seconds ..</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=631073309-08102007><FONT face=&#26032;&#32048;&#26126;&#39636; 
  color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV dir=ltr align=left><SPAN class=631073309-08102007><FONT face=&#26032;&#32048;&#26126;&#39636; 
  color=#0000ff size=2>It is so amazing.</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=631073309-08102007><FONT face=&#26032;&#32048;&#26126;&#39636; 
  color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV dir=ltr align=left><SPAN class=631073309-08102007><FONT face=&#26032;&#32048;&#26126;&#39636; 
  color=#0000ff size=2>Mark</FONT></SPAN></DIV></FONT></DIV><BR>
  <BLOCKQUOTE dir=ltr 
  style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
    <DIV class=OutlookMessageHeader lang=zh-tw dir=ltr align=left>
    <HR tabIndex=-1>
    <FONT face=Tahoma size=2><B>From:</B> Mark Wu [mailto:markplace@gmail.com] 
    <BR><B>Sent:</B> Monday, October 08, 2007 5:23 PM<BR><B>To:</B> 'LifeType 
    Developer List'<BR><B>Subject:</B> RE: [pLog-svn] __autoload very slow 
    ...<BR></FONT><BR></DIV>
    <DIV></DIV>
    <DIV dir=ltr align=left><SPAN class=883251909-08102007><FONT face=&#26032;&#32048;&#26126;&#39636; 
    color=#0000ff size=2>Hi All:</FONT></SPAN></DIV>
    <DIV dir=ltr align=left><SPAN class=883251909-08102007><FONT face=&#26032;&#32048;&#26126;&#39636; 
    color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
    <DIV dir=ltr align=left><SPAN class=883251909-08102007><FONT face=&#26032;&#32048;&#26126;&#39636; 
    color=#0000ff size=2>I just attached my profiling file and the result with 
    wincachegrined. You can see the bottle neck is in 
    file_exists.</FONT></SPAN></DIV>
    <DIV dir=ltr align=left><SPAN class=883251909-08102007><FONT face=&#26032;&#32048;&#26126;&#39636; 
    color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
    <DIV dir=ltr align=left><SPAN class=883251909-08102007><FONT face=&#26032;&#32048;&#26126;&#39636; 
    color=#0000ff size=2>It takks about 12 seconds.</FONT></SPAN></DIV>
    <DIV dir=ltr align=left><SPAN class=883251909-08102007><FONT face=&#26032;&#32048;&#26126;&#39636; 
    color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
    <DIV dir=ltr align=left><SPAN class=883251909-08102007><FONT face=&#26032;&#32048;&#26126;&#39636; 
    color=#0000ff size=2>wow ...</FONT></SPAN></DIV>
    <DIV dir=ltr align=left><SPAN class=883251909-08102007><FONT face=&#26032;&#32048;&#26126;&#39636; 
    color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
    <DIV dir=ltr align=left><SPAN class=883251909-08102007><FONT face=&#26032;&#32048;&#26126;&#39636; 
    color=#0000ff size=2>Mark</FONT></SPAN></DIV>
    <DIV dir=ltr align=left><FONT face=&#26032;&#32048;&#26126;&#39636; color=#0000ff 
    size=2></FONT>&nbsp;</DIV><BR>
    <BLOCKQUOTE dir=ltr 
    style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
      <DIV class=OutlookMessageHeader lang=zh-tw dir=ltr align=left>
      <HR tabIndex=-1>
      <FONT face=Tahoma size=2><B>From:</B> plog-svn-bounces@devel.lifetype.net 
      [mailto:plog-svn-bounces@devel.lifetype.net] <B>On Behalf Of </B>Mark 
      Wu<BR><B>Sent:</B> Monday, October 08, 2007 4:16 PM<BR><B>To:</B> 
      'LifeType Developer List'<BR><B>Subject:</B> [pLog-svn] __autoload very 
      slow ...<BR></FONT><BR></DIV>
      <DIV></DIV>
      <DIV><FONT face=&#26032;&#32048;&#26126;&#39636; size=2><SPAN class=012011108-08102007>Hi 
      Oscar:</SPAN></FONT></DIV>
      <DIV><FONT face=&#26032;&#32048;&#26126;&#39636; size=2><SPAN 
      class=012011108-08102007></SPAN></FONT>&nbsp;</DIV>
      <DIV><FONT face=&#26032;&#32048;&#26126;&#39636; size=2><SPAN class=012011108-08102007>I just test the 
      new autoload under windows, the performace is very bad under windows ( 
      apache 2.2.4, PHP5 5.2.3 &amp; Mysql 5.0)</SPAN></FONT></DIV>
      <DIV><FONT face=&#26032;&#32048;&#26126;&#39636; size=2><SPAN 
      class=012011108-08102007></SPAN></FONT>&nbsp;</DIV>
      <DIV><FONT face=&#26032;&#32048;&#26126;&#39636; size=2><SPAN class=012011108-08102007>In original 
      lt_include version, every request can finished within less 1-2 
      seconds.</SPAN></FONT></DIV>
      <DIV><FONT face=&#26032;&#32048;&#26126;&#39636; size=2><SPAN 
      class=012011108-08102007></SPAN></FONT>&nbsp;</DIV>
      <DIV><FONT face=&#26032;&#32048;&#26126;&#39636; size=2><SPAN class=012011108-08102007>But, in new 
      autoload version, every request takes almost&nbsp;25-35 seconds to show up 
      the page ...</SPAN></FONT></DIV>
      <DIV><FONT face=&#26032;&#32048;&#26126;&#39636; size=2><SPAN 
      class=012011108-08102007></SPAN></FONT>&nbsp;</DIV>
      <DIV><FONT face=&#26032;&#32048;&#26126;&#39636; size=2><SPAN class=012011108-08102007>I check the cpu 
      loading, it always in 100%. It seems PHP just try&nbsp;search the include 
      files recursivelly</SPAN></FONT></DIV>
      <DIV><FONT face=&#26032;&#32048;&#26126;&#39636; size=2><SPAN 
      class=012011108-08102007></SPAN></FONT>&nbsp;</DIV>
      <DIV><FONT face=&#26032;&#32048;&#26126;&#39636; size=2><SPAN class=012011108-08102007>It is really 
      terrible ....</SPAN></FONT></DIV>
      <DIV><FONT face=&#26032;&#32048;&#26126;&#39636; size=2><SPAN 
      class=012011108-08102007></SPAN></FONT>&nbsp;</DIV>
      <DIV><FONT face=&#26032;&#32048;&#26126;&#39636; size=2><SPAN class=012011108-08102007>Do I need to do 
      any special setup in PHP.ini for autoload?</SPAN></FONT></DIV>
      <DIV><FONT face=&#26032;&#32048;&#26126;&#39636; size=2><SPAN 
      class=012011108-08102007></SPAN></FONT>&nbsp;</DIV>
      <DIV><FONT face=&#26032;&#32048;&#26126;&#39636; size=2><SPAN 
      class=012011108-08102007>Mark</SPAN></FONT></DIV>
      <DIV><FONT face=&#26032;&#32048;&#26126;&#39636; size=2><SPAN 
      class=012011108-08102007></SPAN></FONT>&nbsp;</DIV>
      <DIV><FONT face=&#26032;&#32048;&#26126;&#39636; size=2><SPAN 
      class=012011108-08102007></SPAN></FONT>&nbsp;</DIV></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>