RE: [PHP] Question concerning performance

From: Date: Wed, 17 Jan 2001 17:49:30 +0000
Subject: RE: [PHP] Question concerning performance
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-35085@lists.php.net to get a copy of this message
Now THAT's the kind of answer I was looking for. Thanks very much for checking that out. Mind if I ask what you used for your benchmarking/timing software-wise? blest, jeremy -- Jeremy Kelley <jeremy@33ad.org> pgp keyid 0xAECBA355 Phil 1:21 www.ganooz.com Car pour moi, la vie c'est le Christ, et la mort est un gain. > -----Original Message----- > From: Toby Butzon [mailto:php-lists@imawebdesigner.com] > Sent: Wednesday, January 17, 2001 16:55 > To: jeremy; php-general@lists.php.net > Subject: Re: [PHP] Question concerning performance > > > > 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]-------------- > > Ran a pretty rough benchmark: 10040 lines of code (5020 > repetitions of the > above example) 10 times with an average execution time of > 6.07904628515244 > seconds. > > > > 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]-------------- > > Same benchmark, except these two lines were used instead of > the two lines > in the above case (obviously). Again, 10 executions; this > time the average > execution time was 6.40339350700379 seconds. > > There are 100 ways error could've been introduced into this > test; even so, > the results seem to lean towards not switching between html & > php modes... > although, you're talking about 1000 lines of code, and the > test used 10 > times that, and the resulting difference was a little more > than 3 tenths of > a second... if you compared it with 1/10th of the code (your 1000 line > file), you'd probably have a difference in the hundredths-of-a-second > range. > > It's up to you, but I agree with what Christian said - I'd > probably shoot > for being able to maintain the code; with such a little speed > difference > you might as well set up more servers than optimize for 1/5th > of a second > in execution time. > > --Toby > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: > php-list-admin@lists.php.net >

« previous php.general (#35085) next »