Re: Re: [PHP3] Re: [PHP-DEV] Re: [PHP3] PHP Speed Optimization
| From: | Andi Gutmans | Date: | Mon, 24 Apr 2000 21:16:41 +0000 |
| Subject: | Re: Re: [PHP3] Re: [PHP-DEV] Re: [PHP3] PHP Speed Optimization | ||
| References: | 1 2 3 4 5 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-18160@lists.php.net to get a copy of this message | ||
At 01:53 AM 4/25/00 +0500, Faisal Nasim wrote:
| Say you have 30 user-built functions in *one* file, 200 lines of code. | Depending on your code base/version, if those are called 10 times per page, | you need to include that code for the parser (file call), and | then as you go through the page, it substitutes out the function code.... | plus you've added 20 useless functions of overhead for *every* | parsed page. (Hence, the speed differences between 3 and 4, and the | problem with using functions in 3. They *will* bog your execution | down) Its there parsed once sitting in the memory, it doesn't actually substitute the function contents with the function call and then process is as if it was embedded in the code itself! Its done through a smart method. | | Lots and lots of overhead in that. If you can strip excess functions | out, and speed is your goal, by all means, dump them over the side | as fast as you can, and explicitly code using PHP's internal | functions. Try two or three variants on your code, to see if, for | example, you could get a faster result from a printf or an echo, | a faster loop by only testing (if/case) under a smaller set of | circumstances, and, if you can, avoid *ever* using requires or | includes.... Seems like you have mixed C with PHP. PHP functions don't have overhead like C does (unless they are inline, the overhead is negligible, but its there!)PHP function calls have overhead similar to the way C does. The parameters are passed etc. etc.. Andi --- Andi Gutmans <andi@zend.com> http://www.zend.com/