Re: More on windows performance

From: Date: Wed, 07 Jun 2000 20:16:21 +0000
Subject: Re: More on windows performance
References: 1 2  Groups: php.windows 
Request: Send a blank email to php-windows+get-299@lists.php.net to get a copy of this message
Aye. I will describe both files again: 1) The 'html' file looks like this: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx .... etc xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 2) The 'print' file looks like this: <? print 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'; print 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'; .... etc print 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'; ?> (Both actually contain 1000 lines of 100 xes.) File 2 is twice as fast as file 1. Both are no where near as fast as linux. I have repeated similar observations on 3 other computers. Windows NT 4sp4, 4sp6, 2000. Yet I'm not sure anyone has been able to successfully repeat my experiment. Here's some comparisons: $ time cat speed-100k-html.php > dumpfile real 0m0.094s $ time ./php3.exe speed-100k-html.php > dumpfile real 0m0.235s $ time ./php4.exe speed-100k-html.php > dumpfile real 0m6.625s -joel Drew Kime wrote: > > Perhaps one of you can decipher these numbers... It seems to me that > > the user+sys time only adds up to over 0.06 seconds. Which I believe > > would be the time that something like this SHOULD actually take. > > However, the actual elapsed time is odd because: a) its so slow, b) the > > print statements are so much faster than raw characters. > > I suspect the speed is due to the server not having to parse through all > those characters. If you have any type of parsing happening on your raw > HTML files -- for SSI, etc. -- the server has to parse through every single > character looking for control codes. With the single print statement in a > loop, it is able to simply execute the command. > > I have no figures to back up this supposition, but it has a "common sense" > logic to it. See how long it takes (you, not a computer) to find the string > "<?" in a file of 100,000 random characters, then see how long it takes to > find the same string in the file: > <? while ($i < 100000): > echo("*"); > $i++; > endwhile ?> > It parses much faster, then just spits out the characters. Has anyone done > a test of raw HTML output speed with all parsing, including SSI, disabled? > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net > For additional commands, e-mail: php-windows-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.windows (#299) next »