php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28918 include_once() relatively slow
Submitted: 2004-06-25 13:20 UTC Modified: 2004-06-25 17:47 UTC
From: mail at spybreak dot de Assigned:
Status: Not a bug Package: Performance problem
PHP Version: 4.3.6 OS: Windows 2000
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mail at spybreak dot de
New email:
PHP Version: OS:

 

 [2004-06-25 13:20 UTC] mail at spybreak dot de
Description:
------------
I noticed when timing my scripts that include_once is pretty slow when one looks at how simple of a job this function has.

I timed an example further down.

Please don't disregard this request just because it might not seem very important. If it can't be improved though, C is not my domain, nevermind and thanks for reading :)

Reproduce code:
---------------
include_once(components_dir.'style.php');
/* 0.0026910305023193 seconds */


include_once(components_dir.'style.php'); 
/* 0.00091314315795898 seconds
   only three times as fast as the first include_once call! whereas the next example?*/


$array = array('somefile.php','somefile.php','somefile.php','somefile.php','somefile.php',
               'somefile.php','somefile.php','somefile.php','somefile.php','somefile.php');
in_array('someotherfile.php',$array);
/* only takes 0.000065088272094727 seconds and hence is 40x as fast (if my calculations are correct) */


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-06-25 17:47 UTC] pollita@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 09:01:29 2024 UTC