PHP vs Servlet, where is php_java

From: Date: Fri, 05 May 2000 18:13:31 +0000
Subject: PHP vs Servlet, where is php_java
Groups: php.version4 
Request: Send a blank email to php-version4+get-13135@lists.php.net to get a copy of this message
This is a message from SUN.com, ---------- From: Cezar Totth cezar@GENESYS.RO To: SERVLET-INTEREST@JAVA.SUN.COM Subject: Re: Fw: (is servlet really faster?) Php Vs Servlet, unexpected result, why? Date: Mon, Jul 12, 1999, 2:21 AM Hi, PHP might work faster on simple tests because it has a very large, powerfull library already compiled as native code, so even it is basically an interpreter, all native-code functions are faster than equivalent java bytecode. But the interpreted (PHP's language) libraries you might need to provide to build will be almost sure slower than java bytecode... Other advantages of java vs. PHP: - More powerfull object-oriented language, - Java better for large projects. - Lots of libraries, - Performance can be improved by using faster JVMs or faster servlet engines. - Have not working for long with PHP but I dont remember it keeping session state. (even considering the fact it can run as plain CGI) - Limited number of databases supported. Database calls are very much database-dependent, changing database used might be a lot of pain.. Improvments to servlets on Linux.. - Use a JIT compiler, IBM has a new one, follow links at http://alphaworks.ibm.com Also the Kaffe JVM from http://www.kaffe.org might help. - !!! Try to measure the performance with the JSDK's provided servlet engine. Dont know about jserv1.0b5, but mine jserv0.9.11 was much slower than JSDK's engine... Don't know if it was due to missconfigurations, but anyway JSDK's servlet engine is pretty fast to be used as a ... refference. - Printing dates in Java may require a lot of CPU resources. On some of my tests I found that printing dates may take most % from processing a HTTP request. Try to instantiate a DateFormat and re-use it to print more than one Date. (DateFormat.format(Date) call) Otherwise Date.toString(), each time it is called, creates locally a TimeZone and DateFormat instance then tell it to format(this). This is expensive. ------------------ Bye, Cezar.

« previous php.version4 (#13135) next »