![]() |
|
Welcome to the Computer Webmaster Gaming Console Graphics Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| |||||||
| PHP PHP for some can be one of the hardest website programming codes, so do you need help on your PHP script, if it is php4, php5 or lower this is the place for you for any PHP help. |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 | ||
| Hi, I've compiled the latest php out of CVS and I'm having the same (wacky) performance trouble that I've had before. I have cygwin on my machine that I'm currently using 'time' to test php.exe with my ~100k files of xes. The Release_TS_inline numbers appear to be only slightly faster than the Release_TS numbers. The binary windows php-4.0.0 release is faster still. Using the command: time ./php.exe speed-100k-html.php > dump For my file with just 100,000 xes, I get this time: 0m7.750s real 0m0.031s user 0m0.031s sys For my file that <? print ?>s 100,000 chars, I get this time: 0m3.016s real 0m0.046s user 0m0.015s sys And for php3 I get: 0m0.250s real 0m0.031s user 0m0.031s sys 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. If it would help for me to mail anyone the files I am testing, I will... I would attatch them here, but they are 200k and it is so easy to recreate such things in vi ('100ixESCyy999pp'). When I compiled from cvs, the only change I made was adding ext/standard/scanf.[ch] to the project, because a couple files referenced php_sscanf_internal. If you can lend any suggestions for what I might do to get this time down, please, mail 'em off to me. -joel | |||
|
| Advertisements |
| | #2 | ||
| > 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? | |||
|
| | #3 | ||
| 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 | |||
|
| Featured Websites | ||||
|
![]() |
| Tags: |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [PHP4BETA] Wacky Performance Problem w/ Windows | Zeev Suraski | PHP | 0 | 02-05-2008 11:21 AM |
| [PHP-WINDOWS] PHP4 extensions on Windows platform | huib Bakker | PHP | 1 | 02-05-2008 11:20 AM |
| Performance of ATR0635 and GSC3f | eeh | GPS | 0 | 06-25-2007 11:05 PM |
| Windows Media Player 11 under Windows Vista | Emmanuel Debrosse | Windows | 4 | 05-28-2007 10:29 PM |
| Featured Websites | ||||
|