Wacky Performance Problem w/ Windows

[email protected] (Joel Roller) Thu, 01 Jun 2000 13:02:16 -0500
Newsgroups php.version4
Message-ID <[email protected]>
Hello,

I'd really like to start using php4 on my NT machines, but the
performance seems completely wacky.  I can understand the windows
version lagging behind unix, but when there's multiple orders of
magnitude difference in speed, I get confused.

Leaving aside the fact that IIS4/isapi php is so much slower for a
sec..  Php4 on windows parses php (stuff within <? tags ?>) between 2
and 5 times faster than html.   Here are outlines of the test files that
I have been using:

File 1:
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
repeat 998 times here ...
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

File 2:
<?
print 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
repeat 998 times here ...
print 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
?>

I have tried IIS4/isapi, IIS4/cgi, Apache/cgi, all on windows, and get
the same results:  File 2 is much faster than File 1.  And all are
around 50 times slower than the same file on linux/apache/mod_php.

If this cannon be explained (I really hope someone has a reason/possible
fix), let this email be a tip to anyone on the windows platform.   You
can speed up the godawful performance on windows by enclosing your
entire html in <? print ?> statements.   I myself have improved the
loading of my homepage from 7 seconds to 3.5 seconds, just by taking
major blocks of html and using the magic -
<? print <<<EOF
Fun feature of php4.
EOF;
?>

The thing that seriously confuses me, is that php3 doesn't at all suffer
from near the same performance problems.

I have posted similar pleas of confusion and frustration on PHP-WINDOWS
and Zend.com / Forums / PHP General with no replies.   Please help me.

-joel