Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP vs JSP

Status
Not open for further replies.

likeopensource

Programmer
Nov 28, 2002
27
IN
I have been told this too many times and cannot answer.

Since JSP(Java Server Pages) is compiled only once while PHP is interpreted every time, after the first compilation JSP is much faster than PHP.

I have read at many places that PHP is the fastest in scripting languages. How do I answer this?

 
By definition, a scripting language must be interpreted. So the comparision of PHP to other languages may not have included Java.

[Although, to a certain extent, even Java is interpreted -- it's not compiled to a standalone executable, but to an intermediate code form, which is interpreted by the Java Virtual Machine. The efficiency of your machine is what makes you or breaks you.]

PHP can also be compiled to an intermediate form using a Zend product called Zend Encoder, which is used to compile PHP to a distributable but obfuscated form (the product is for-pay, but the software to run the p-code is free). Encoder's code optimizer can improve PHP's already notable speed. Maybe Java and PHP were compared, using Encoder.

Want the best answers? Ask the best questions: TANSTAAFL!
 
JSP pages (although I am probably wrong) are checked for changes everytime but then doesn't have to recompile if there are no changes. iSeriesCodePoet
IBM iSeries (AS/400) Programmer
[pc2]
 
Actually, aside from the Zend encoder, PHP has several ways of doing exactly what JSP does: keeping a cached, compiled version of the script in memory.

The Zend optimizer is the most basic of these choices. It is free, and provides a certain amount of pre-compilation.

The Zend Performance Suite is a commercial add-on, and it not only pre-compiles scripts, but it actually caches content also, and compresses content for delivery to the browser.

There are also a couple of alternative PHP opcode-producers (read on such as:

1. After Burner -- 2. APC (Alternative PHP Cache) -- 3. ionCube PHP Accelerator -- -------------------------------------------

PHP/Perl/SQL/Javascript --
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top