Re: Re: Code Bulk
| From: | Gerard Samuel | Date: | Wed, 27 Mar 2002 01:27:37 +0000 |
| Subject: | Re: Re: Code Bulk | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-90304@lists.php.net to get a copy of this message | ||
That is an excellent example.
And just for the hell of it, Ill leave the lines that aren't in the function as is, just for the hell of it.
Thanks.
Philip Hallstrom wrote:
Why not just take that file and remove anything that isn't a function (so nothing actually executes) and then do something like: print microtime(); include "thatfile.php"; print microtime(); and see how long it took to parse 3000 lines... one more line isn't going to make that much difference. On Tue, 26 Mar 2002, Gerard Samuel wrote:Actually, the file in question is 3000 lines long, 99% in functions. Im trying to tell him that he may not see any speed ups in code execution. As long as I know Im right, its just the peace of mind when I go to bed tonight :) Martin Towell wrote:any speed difference will be miniscule/negligible - is speed, to the microsecond, important in this situation? -----Original Message----- From: Gerard Samuel [mailto:gsam@trini0.org] Sent: Wednesday, March 27, 2002 11:23 AM To: PHP Subject: Code Bulk Im in a debate with someone else. Basically were debating code bulk. This is just an example -> <?php if (isset($run_this_code)) {-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phpecho $this->run_this_code;} echo 'Finished'; ?> Now, if I understand php correctly, the whole script gets parsed, but since $run_this code isn't set, $this->run_this_code doesn't get echoed/executed. What this other person is telling me that its more effiecient for *him* to have -> <?php echo 'Finished'; ?> instead. The script is a general purpose script. Its not built for one person. Some may use $run_this_code and some may not. So in taking out that bit of code, all it does is save the parser, what fraction of a fraction of a second?? Im just looking for ammunition so I could go and shoot this guy down... :) Thanks for listening