<!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.16587" name=GENERATOR></HEAD>
<BODY 
style="WORD-WRAP: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space">
<DIV dir=ltr align=left><SPAN class=849463416-02022008><FONT face=&#26032;&#32048;&#26126;&#39636; 
color=#0000ff size=2>Hi Oscar:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=849463416-02022008><FONT face=&#26032;&#32048;&#26126;&#39636; 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=849463416-02022008><FONT face=&#26032;&#32048;&#26126;&#39636; 
color=#0000ff size=2>1. About the&nbsp; array_merge(), I just check the result 
again.... I think it is slow becasue the include(), not array_merge. In my test 
case, I need to load extra 14 locale files... So, there is nothing we can do 
with it...&nbsp; :(</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=849463416-02022008><FONT face=&#26032;&#32048;&#26126;&#39636; 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=849463416-02022008><FONT face=&#26032;&#32048;&#26126;&#39636; 
color=#0000ff size=2>Maybe ask user or develer merge thier plugin locale into 
the core and reduce the file I/O access in thier production 
server.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=849463416-02022008><FONT face=&#26032;&#32048;&#26126;&#39636; 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=849463416-02022008><FONT face=&#26032;&#32048;&#26126;&#39636; 
color=#0000ff size=2>2. Do you have any ideas about the menu structure? Maybe I 
can try to implement it... </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=849463416-02022008><FONT face=&#26032;&#32048;&#26126;&#39636; 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=849463416-02022008><FONT face=&#26032;&#32048;&#26126;&#39636; 
color=#0000ff size=2>3. About the admin page cache, any 
ideas?</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=849463416-02022008><FONT face=&#26032;&#32048;&#26126;&#39636; 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=849463416-02022008><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> plog-svn-bounces@devel.lifetype.net 
  [mailto:plog-svn-bounces@devel.lifetype.net] <B>On Behalf Of </B>Oscar 
  Renalias<BR><B>Sent:</B> Saturday, February 02, 2008 5:32 PM<BR><B>To:</B> 
  LifeType Developer List<BR><B>Subject:</B> Re: [pLog-svn] A terrible truth 
  about plugin<BR></FONT><BR></DIV>
  <DIV></DIV>I had already been considering to replace menu.xml with something 
  else, probably with a native array (so that we can store all the different 
  attributes that are stored in the menu file) and then while keeping the API 
  interface, replace the code inside. But I obviously have not had the time...
  <DIV><BR class=webkit-block-placeholder></DIV>
  <DIV>I would drop the XML and consider a multidimensional array.</DIV>
  <DIV><BR class=webkit-block-placeholder></DIV>
  <DIV>About the locales, what's the performance penalty of using array_merge? 
  Is array_merge the slow part or is it something else?<BR>
  <DIV><BR>
  <DIV>
  <DIV>On Feb 1, 2008, at 8:20 PM, Mark Wu wrote:</DIV><BR 
  class=Apple-interchange-newline>
  <BLOCKQUOTE type="cite">
    <DIV>
    <DIV><FONT face="f&#22;0g40f&#24;&#14;i+&#20;" size=2><SPAN 
    class=364065717-01022008>After several testing, I think I know why our 
    plugin is so slow...</SPAN></FONT></DIV>
    <DIV><FONT face="f&#22;0g40f&#24;&#14;i+&#20;" size=2><SPAN 
    class=364065717-01022008></SPAN></FONT>&nbsp;</DIV>
    <DIV><FONT face="f&#22;0g40f&#24;&#14;i+&#20;" size=2><SPAN 
    class=364065717-01022008>The problem is plugin menu &amp; locales 
    :(</SPAN></FONT></DIV>
    <DIV><FONT face="f&#22;0g40f&#24;&#14;i+&#20;" size=2><SPAN 
    class=364065717-01022008></SPAN></FONT>&nbsp;</DIV>
    <DIV><FONT face="f&#22;0g40f&#24;&#14;i+&#20;" size=2><SPAN 
    class=364065717-01022008>In our plugin framework, we can add menu on the 
    fly, it is good. But it use XML_Tree(from pear), and it always lookup the 
    specific node and add the plugin&nbsp;menu as its child in each request. So, 
    if we have 1 plugin, and 2 menu entries, it will search the menu tree twice. 
    If we have 14 plugins and each plugin has 2 menu entries, it will search 28 
    times ....</SPAN></FONT></DIV>
    <DIV><FONT face="f&#22;0g40f&#24;&#14;i+&#20;" size=2><SPAN 
    class=364065717-01022008></SPAN></FONT>&nbsp;</DIV>
    <DIV><FONT face="f&#22;0g40f&#24;&#14;i+&#20;" size=2><SPAN 
    class=364065717-01022008>The second problem is our plugin locales. Iit use 
    array_merge() to merge the plugin locales into core locales.... 
    </SPAN></FONT></DIV>
    <DIV><FONT face="f&#22;0g40f&#24;&#14;i+&#20;" size=2><SPAN 
    class=364065717-01022008></SPAN></FONT>&nbsp;</DIV>
    <DIV><FONT face="f&#22;0g40f&#24;&#14;i+&#20;" size=2><SPAN 
    class=364065717-01022008>For 1st problem, I have no idea how to solve it, 
    maybe we can change it to simplexml (native xml support) in php5 to see it 
    increse any performance or not.</SPAN></FONT></DIV>
    <DIV><FONT face="f&#22;0g40f&#24;&#14;i+&#20;" size=2><SPAN 
    class=364065717-01022008></SPAN></FONT>&nbsp;</DIV>
    <DIV><FONT face="f&#22;0g40f&#24;&#14;i+&#20;" size=2><SPAN 
    class=364065717-01022008>For 2nd problem, maybe we can use include() only, 
    </SPAN></FONT></DIV>
    <DIV><FONT face="f&#22;0g40f&#24;&#14;i+&#20;" size=2><SPAN 
    class=364065717-01022008></SPAN></FONT>&nbsp;</DIV>
    <DIV><FONT face="f&#22;0g40f&#24;&#14;i+&#20;" size=2><SPAN 
    class=364065717-01022008>For production server, I think add all menu to 
    menu.xml and all locales to core locale file is very 
    helpful......</SPAN></FONT></DIV>
    <DIV><FONT face="f&#22;0g40f&#24;&#14;i+&#20;" size=2><SPAN 
    class=364065717-01022008></SPAN></FONT>&nbsp;</DIV>
    <DIV><FONT face="f&#22;0g40f&#24;&#14;i+&#20;" size=2><SPAN 
    class=364065717-01022008>====</SPAN></FONT></DIV>
    <DIV><FONT face="f&#22;0g40f&#24;&#14;i+&#20;" size=2><SPAN 
    class=364065717-01022008></SPAN></FONT>&nbsp;</DIV>
    <DIV><FONT face="f&#22;0g40f&#24;&#14;i+&#20;" size=2><SPAN 
    class=364065717-01022008>Here is the test result when I open 
    editArticleCategories page: (I test it under&nbsp; php5, apache 2.2 &amp; 
    mysql5 on a slow pentium M 1.8GHZ with 2G ram with window 
    xp)</SPAN></FONT></DIV>
    <DIV><FONT face="f&#22;0g40f&#24;&#14;i+&#20;" size=2><SPAN 
    class=364065717-01022008></SPAN></FONT>&nbsp;</DIV>
    <DIV><FONT face="f&#22;0g40f&#24;&#14;i+&#20;" size=2><SPAN 
    class=364065717-01022008>1. LifeType core + 14 plugins (8 with xml menu 
    entries setting) : 1000 ms</SPAN></FONT></DIV>
    <DIV><FONT face="f&#22;0g40f&#24;&#14;i+&#20;" size=2><SPAN 
    class=364065717-01022008>2. (1) and remove all locale files : 
    900ms</SPAN></FONT></DIV>
    <DIV><FONT face="f&#22;0g40f&#24;&#14;i+&#20;" size=2><SPAN 
    class=364065717-01022008>3. (1) and remove all plugins: 
    550ms</SPAN></FONT></DIV>
    <DIV><FONT face="f&#22;0g40f&#24;&#14;i+&#20;" size=2><SPAN 
    class=364065717-01022008></SPAN></FONT>&nbsp;</DIV>
    <DIV><FONT face="f&#22;0g40f&#24;&#14;i+&#20;" size=2><SPAN 
    class=364065717-01022008>Just for your reference.</SPAN></FONT></DIV>
    <DIV><FONT face="f&#22;0g40f&#24;&#14;i+&#20;" size=2><SPAN 
    class=364065717-01022008></SPAN></FONT>&nbsp;</DIV>
    <DIV><FONT face="f&#22;0g40f&#24;&#14;i+&#20;" size=2><SPAN 
    class=364065717-01022008>Mark</SPAN></FONT></DIV>
    <DIV><FONT face="f&#22;0g40f&#24;&#14;i+&#20;" size=2><SPAN 
    class=364065717-01022008></SPAN></FONT>&nbsp;</DIV>
    <DIV><FONT face="f&#22;0g40f&#24;&#14;i+&#20;" size=2><SPAN 
    class=364065717-01022008></SPAN></FONT>&nbsp;</DIV>
    <DIV><FONT face="f&#22;0g40f&#24;&#14;i+&#20;" size=2><SPAN 
    class=364065717-01022008></SPAN></FONT>&nbsp;</DIV></DIV>_______________________________________________<BR>pLog-svn 
    mailing list<BR><A 
    href="mailto:pLog-svn@devel.lifetype.net">pLog-svn@devel.lifetype.net</A><BR>http://limedaley.com/mailman/listinfo/plog-svn</BLOCKQUOTE></DIV><BR></DIV></DIV></BLOCKQUOTE></BODY></HTML>