[pLog-svn] __autoload very slow ...

Oscar Renalias oscar at renalias.net
Mon Oct 8 08:11:46 EDT 2007


I was wondering how long it will take people to test this... Not long :)

We can create a pre-defined array that contains the locations of all
files. Although there's quite many of those, finding a single file
should be pretty quick.

But if it's a performance problem in windows, maybe there isn't much
we can do. All I can say is that I felt no performance increase or
decrease in my OS X laptop, and OS X is not exactly known for being a
speed demon.

On 10/8/07, Mark Wu <markplace at gmail.com> wrote:
>
>
> Actually, I will suggest we revert to the old way + autoload new features.
>
> So, if developer know lifetype very well, then he can include the lifetype
> related files by him self in front of each scripts.
>
> If he is a new developer, then he can enjoy the benifit from the new
> autoload feature (With the pre-scan scripts array as I suggested) .
>
> Mark
>
>
>  ________________________________
>  From: Mark Wu [mailto:markplace at gmail.com]
> Sent: Monday, October 08, 2007 5:58 PM
>
> To: 'LifeType Developer List'
> Subject: RE: [pLog-svn] __autoload very slow ...
>
>
>
> I just check the code, there are several stuffs will impact the performance:
>
> 1. The order of folders:
>     - If the file is locate in the last folder, then the autload have to
> check all the folders
>
> 2. The number of folders:
>     -There are about 110 folders in the folder list array.  I think it is
> too much folders for autoload
>
> 3. The file I/O
>     - It seems the file I/O under windws is much worse then Unix/Linux, that
> why Oscar feel no big difference with autoload.
>
> 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.
>
> To generate a $include_script[$key] = $value; file for autoload.
>
> Then we just use array_key_exist to check the $key exist or not. Then
> include the file.
>
> It will save a lot of time.
>
> Mark
>
>
>  ________________________________
>  From: Mark Wu [mailto:markplace at gmail.com]
> Sent: Monday, October 08, 2007 5:36 PM
> To: 'LifeType Developer List'
> Subject: RE: [pLog-svn] __autoload very slow ...
>
>
>
>
> I forgot to say this is the result of admin.php?op=newPost
>
> You can see there are over 7700 function call of file_exists().
>
> If each file_exists call() takes 1 ms. It will takes 15 seconds ..
>
> It is so amazing.
>
> Mark
>
>
>  ________________________________
>  From: Mark Wu [mailto:markplace at gmail.com]
> Sent: Monday, October 08, 2007 5:23 PM
> To: 'LifeType Developer List'
> Subject: RE: [pLog-svn] __autoload very slow ...
>
>
>
> Hi All:
>
> I just attached my profiling file and the result with wincachegrined. You
> can see the bottle neck is in file_exists.
>
> It takks about 12 seconds.
>
> wow ...
>
> Mark
>
>
>
>  ________________________________
>  From: plog-svn-bounces at devel.lifetype.net
> [mailto:plog-svn-bounces at devel.lifetype.net] On Behalf Of
> Mark Wu
> Sent: Monday, October 08, 2007 4:16 PM
> To: 'LifeType Developer List'
> Subject: [pLog-svn] __autoload very slow ...
>
>
>
> Hi Oscar:
>
> I just test the new autoload under windows, the performace is very bad under
> windows ( apache 2.2.4, PHP5 5.2.3 & Mysql 5.0)
>
> In original lt_include version, every request can finished within less 1-2
> seconds.
>
> But, in new autoload version, every request takes almost 25-35 seconds to
> show up the page ...
>
> I check the cpu loading, it always in 100%. It seems PHP just try search the
> include files recursivelly
>
> It is really terrible ....
>
> Do I need to do any special setup in PHP.ini for autoload?
>
> Mark
>
>
> _______________________________________________
> pLog-svn mailing list
> pLog-svn at devel.lifetype.net
> http://limedaley.com/mailman/listinfo/plog-svn
>


More information about the pLog-svn mailing list