Re: Question concerning performance

From: Date: Wed, 17 Jan 2001 13:46:40 +0000
Subject: Re: Question concerning performance
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-35037@lists.php.net to get a copy of this message
On Wednesday 17 January 2001 11:37, jeremy wrote: > Example ONE: (in just parse mode) > --------[cut]--------------- > <? > print "<html-tag>blah blah blah blah blah blah blah</html-tag>"; > print "<html-tag>" . $Var1 . "</html-tag><b-tag>" . $Var2 > . "</b-tag>"; > ?> > --------[/cut]-------------- > > Example TWO: (in html && parse mode) > --------[cut]--------------- > <html-tag>blah blah blah blah blah blah blah</html-tag> > <html-tag><?=$Var1;?></html-tag><b-tag><?=$Var2;?></b-tag> > --------[/cut]-------------- > > Now, let me elaborate. I'm quite aware that the above 2 code segments > will both be fast enough for me not to care. BUT, within an > application that has 1000 lines of code per page (hypothetically), > everything begins to matter, and the more cpu-clicks I can save, the > happier I'll be. With big applications the *main* thing that matters is maintainability. In other words: Make it work, make it work well, make it maintainable and *then* make it as fast as possible while *keeping* it maintainable (and working of course) > The 2 examples will turn out the same results to the browser, but which > will do it faster? Don't care about it. The difference is most lileky in th 0.1% range. Look at bigger optimizations first, then benchmark and if it still is too slow (and only then) optimize further. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) The most exciting phrase to hear in science, the one that heralds new discoveries, is not "Eureka", but "That's funny..." - Isaac Asimov

« previous php.general (#35037) next »