I've inherited a web-site where certain pages 'include' over 30 files
(arrrgh!), it runs fine. In fact I'm actually very impressed with the
performance of PHP with many includes.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: 20 March 2001 09:44
To: [EMAIL PROTECTED]
Subject: [PHP-DEV] PHP 4.0 Bug #8945 Updated: include, require, et al.


ID: 8945
Updated by: sbergmann
Reported By: [EMAIL PROTECTED]
Old-Status: Open
Status: Closed
Bug Type: Performance problem
Assigned To:
Comments:

Works for me.

Previous Comments:
---------------------------------------------------------------------------

[2001-03-20 04:23:29] [EMAIL PROTECTED]
Never mind, I think that PHP can't handle parsing too many include files
(Files too large/complex, more than 8 include files, not enough memory/CPU
to handle PHP, whatever etc.)

---------------------------------------------------------------------------

[2001-03-20 03:24:43] [EMAIL PROTECTED]
I don't see your point.

Using require in a conditional block make absolutely NO SENSE, as it gets
executed wheter or not the condition of the block holds true or not.

Of course the performance "decreases" when you load more files into your
application: they need to be scanned, parsed and probably executed.


---------------------------------------------------------------------------

[2001-03-16 17:29:33] [EMAIL PROTECTED]
I tried both include() and require():

<?php
  if(false)
  {
    require "some_file.php";
  }
?>

and

<?php
  if(false)
  {
    include "some_file.php";
  }
?>

Both performed poorly, which is why I'm submitting this report.
At the moment, I've changed my code to use only require() without
conditions, as require() is much faster than include().

Including one more file decreases performance by 2x.
Including another file decreases performance by another 2x.
eg: If you have 8 included files, the performance would be decreased by
256x. This is the performance drop that I'm pointing out here.



---------------------------------------------------------------------------

[2001-03-16 17:00:07] [EMAIL PROTECTED]
No feedback.

--Jani


---------------------------------------------------------------------------

[2001-02-17 13:09:27] [EMAIL PROTECTED]
You say that you use conditional statements to determine whether or not to
REQUIRE a file.

Just to make sure: You're not using require or require_once inside a
conditional block, such as:

<?php
  if($condition)
  {
    require "some_file.php";
  }
?>

I'm asking this, because require and require_once are UNCONDITIONALY called,
see the manual pages for require and include on this topic.


---------------------------------------------------------------------------

The remainder of the comments for this report are too long.  To view the
rest of the comments, please view the bug report online.


ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=8945&edit=2


--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to