|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-06-25 17:47 UTC] pollita@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 07 01:00:01 2025 UTC |
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) */