Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Speed diff between SSI and PHP?

Reply
Thread Tools

Speed diff between SSI and PHP?

 
 
e n | c k m a
Guest
Posts: n/a
 
      07-31-2004
Hello,

Just curious as to whether or not anyone here knows which is faster between
SSI and PHP? My business partner and I are thinking of using either of them
to include files (ie. menus, headers, footers) as part of templates. My mate
wants to use PHP and I'm leaning towards SSI. I've searched google groups
for an answer but found conflicting responses... perhaps it depends on the
application?

I thought perhaps SSI would be faster because it's a local Apache module and
PHP is a third party interpreter... any comments?

Thanks in advance,

Nick.


 
Reply With Quote
 
 
 
 
Leif K-Brooks
Guest
Posts: n/a
 
      07-31-2004
e n | c k m a wrote:
> Just curious as to whether or not anyone here knows which is faster between
> SSI and PHP?


Just tested a simple file with one include in PHP and SSI over 10,000
requests with ApacheBench. The mean average for time per request was
1.207 milloseconds for PHP, and 0.861 for SSI. Of course, if your
application needs to do things SSI can't, you'll want to use something
more complex like PHP.
 
Reply With Quote
 
 
 
 
rf
Guest
Posts: n/a
 
      07-31-2004

"Leif K-Brooks" <> wrote in message
news:...
> e n | c k m a wrote:
> > Just curious as to whether or not anyone here knows which is faster

between
> > SSI and PHP?

>
> Just tested a simple file with one include in PHP and SSI over 10,000
> requests with ApacheBench. The mean average for time per request was
> 1.207 milloseconds for PHP, and 0.861 for SSI. Of course, if your
> application needs to do things SSI can't, you'll want to use something
> more complex like PHP.


So, SSI is .35 milliseconds faster. Compare this to the tens or even
hundreds of milliseconds it takes to get the results back to the client. I
think the difference is irrelevant

--
Cheers
Richard.


 
Reply With Quote
 
Leif K-Brooks
Guest
Posts: n/a
 
      07-31-2004
rf wrote:
> So, SSI is .35 milliseconds faster. Compare this to the tens or even
> hundreds of milliseconds it takes to get the results back to the client. I
> think the difference is irrelevant


Yeah, but some of can't sleep at night because our application is .01
milliseconds too slow.
 
Reply With Quote
 
Shailesh Humbad
Guest
Posts: n/a
 
      07-31-2004
rf wrote:

> "Leif K-Brooks" <> wrote in message
> news:...
>
>>e n | c k m a wrote:
>>
>>>Just curious as to whether or not anyone here knows which is faster

>
> between
>
>>>SSI and PHP?

>>
>>Just tested a simple file with one include in PHP and SSI over 10,000
>>requests with ApacheBench. The mean average for time per request was
>>1.207 milloseconds for PHP, and 0.861 for SSI. Of course, if your
>>application needs to do things SSI can't, you'll want to use something
>>more complex like PHP.

>
>
> So, SSI is .35 milliseconds faster. Compare this to the tens or even
> hundreds of milliseconds it takes to get the results back to the client. I
> think the difference is irrelevant
>


10,000 times .35 is 3500 seconds of server CPU time. That can be
important in some circumstances. My opinion is also that SSI will be
faster than PHP at a raw level. However, the above test is
inconclusive because does not explain whether or not server-side
includes processing was turned off when testing PHP, and if PHP was
turned off when testing SSI. That could make a difference. Also,
there are engines, particularly Zend, which cache PHP output files.
So the particular configuration of your server will highly affect your
results. In any case, switching your include statements between SSI
and PHP is a simple find/replace if you do it right. So just pick
one, and once you build your site, you can evaluate which is faster.
I think processing time for include files is not going to be your
biggest concern.



 
Reply With Quote
 
rf
Guest
Posts: n/a
 
      07-31-2004
Shailesh Humbad wrote:
> rf wrote:


> > So, SSI is .35 milliseconds faster. Compare this to the tens or even
> > hundreds of milliseconds it takes to get the results back to the client.

I
> > think the difference is irrelevant
> >

>
> 10,000 times .35 is 3500 seconds of server CPU time.


Last time I looked 10,000 times .35 *milliseconds* is 3.5 seconds

Insignificant, given that even with a 100MHz nic, and assuming 47000(*)
bytes per hit (including images), it would take 47 seconds just to ship the
data out, ignoring all other network considerations.

(*) plug in your average page size here.

There are threads happenning at the moment that suggest that doing any PHP
(or SSI) will defeat browser/proxy caching, unless carefull attention is
taken with the headers. Eliminating server side processing for just 10% of
your pages (thus enabling caching) would have a far more dramatic effect on
the server than 3.5 seconds of CPU time.

--
Cheers
Richard.


 
Reply With Quote
 
rf
Guest
Posts: n/a
 
      07-31-2004
rf wrote
> Shailesh Humbad wrote:
> > rf wrote:

>
> > > So, SSI is .35 milliseconds faster. Compare this to the tens or even
> > > hundreds of milliseconds it takes to get the results back to the

client.
> I
> > > think the difference is irrelevant
> > >

> >
> > 10,000 times .35 is 3500 seconds of server CPU time.

>
> Last time I looked 10,000 times .35 *milliseconds* is 3.5 seconds
>
> Insignificant, given that even with a 100MHz nic, and assuming 47000(*)
> bytes per hit (including images), it would take 47 seconds just to ship

the
> data out, ignoring all other network considerations.
>
> (*) plug in your average page size here.


Damn, forgot to add this bit:

Consider a chain. You should be worrying real hard about the weakest link in
that chain. You should ignore the bits that have little or no impact on the
performance of the chain.

I once found one of my progammers had spent half a day optimizing a piece of
code. Did well, got it down from one second to half a second CPU time. The
trouble was this peice of code executed once in the initialization section
of a program that ran for over 5 hours. An overall saving of .0027%. We had
a conversation about this

--
Cheers
Richard.


 
Reply With Quote
 
Art Sackett
Guest
Posts: n/a
 
      07-31-2004
rf <rf@.invalid> wrote:

> There are threads happenning at the moment that suggest that doing any PHP
> (or SSI) will defeat browser/proxy caching, unless carefull attention is
> taken with the headers.


To ensure that you don't break caching, use XBitHack and a little RTFM
about setting permissions. Works just fine.

--
Art Sackett,
Patron Saint of Drunken Fornication
 
Reply With Quote
 
Weyoun the Dancing Borg
Guest
Posts: n/a
 
      07-31-2004
e n | c k m a wrote:
> Hello,
>
> Just curious as to whether or not anyone here knows which is faster between
> SSI and PHP? My business partner and I are thinking of using either of them
> to include files (ie. menus, headers, footers) as part of templates. My mate
> wants to use PHP and I'm leaning towards SSI. I've searched google groups
> for an answer but found conflicting responses... perhaps it depends on the
> application?
>
> I thought perhaps SSI would be faster because it's a local Apache module and
> PHP is a third party interpreter... any comments?



SSI is part of PHP
 
Reply With Quote
 
rf
Guest
Posts: n/a
 
      07-31-2004
Weyoun the Dancing Borg

> SSI is part of PHP


Er, what?

What leads you to this conclusion? SSI was around way before PHP was
written.

--
Cheers
Richard.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Diff CSS styles for diff INPUT TYPE='s? A Traveler ASP .Net 6 08-31-2004 09:17 PM
[ANN] Diff::LCS 1.1.0, Diff::LCS 1.0.4 Austin Ziegler Ruby 3 08-09-2004 06:34 AM
diff Process under diff users Cyril Vi?ville Perl 1 06-29-2004 06:22 PM
Same sessionID retuned to diff browsers in diff machines Berrucho ASP .Net 2 12-05-2003 02:23 PM
Exact difference between 'const char *' and 'char *', also diff between 'const' and 'static' Santa C Programming 1 07-17-2003 02:10 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57