Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== Optimizing Execution Time ====== * avoid printf() when echo is all you need * avoid recomputing values inside a loop * don't do this:<code php> for($i=0; $i < count($array); $i++) {/* do something */} </code> * instead, do this:<code php> $num = count($array); for($i=0; $i < $num; $i++) { /* do something */ } </code> * include only files that you need; split the functions into more files if they are not always used together * if using a database, use persistent connections * don't use a regular expression when a simple string-manipulation function will do the job; for example, to turn one character into another in a string, use str_replace(), not preg_replace(). docs/programming/php/optimizing_execution_time.txt Last modified: 2008/08/03 00:25by 127.0.0.1