Zend optimiser can it compete with Java
So I have been looking to learn a new language namely Java.
It has more standards and everything is packaged better for security and management. But I originally thought that Java would be alot fast than PHP especially when processing data and making calculations: however, I came across Zend Optimiser server. So As I understand this will cache the interpreted / compiled PHP script for future use. So would this make PHP as fast as Java if the server is reading machine code rather than having to run it through the PHP engine before sending it to the browser?
PHP6 looks set to become really object orientated which is a good thing but can it compete with Java - just web based applications?
Greg K posted this at 20:10 — 7th July 2010.
He has: 2,145 posts
Joined: Nov 2003
In referencing using Java, are referring to just processing pages on the server side, or actually making stand alone apps or ones to run in the web browser?
For running in the browser, I normally run with Java support disabled, as I normally am running several browser windows at once, and I hate hitting a site that kicks up Java and I am forced to shut all occurrences of the browser to get it to shut back off.
benf posted this at 09:05 — 8th July 2010.
They have: 426 posts
Joined: Feb 2005
HI Greg,
I am not refering to applets, but JSP and servlets running on Tomcat or J2EE and yes, I do mean internet based apps not stand alone apps - which actually is another reason for moving to Java so I can create Mobile apps and standalone apps.
But in terms of web based applications running on a web server, can zend optimiser compete with Java for performance and speed when processing data?
Good Value Professional VPS Hosting
JeevesBond posted this at 05:04 — 11th July 2010.
He has: 3,956 posts
Joined: Jun 2002
Firstly, are you talking about Zend Optimiser or Zend Optimiser+? The former enables PHP to run files compiled by Zend Guard, the latter is an opcode cache and PHP optimizer. Great naming there, not confusing at all *rolleyes*.
Secondly, word on the street is that APC makes code faster than Zend Optimiser+ and even if it weren't it is going to be included in PHP 6 by default, so you should probably be using that instead. I haven't tested Zend vs. APC personally though, let us know if you find a site with benchmarks.
Thirdly, no, I don't think PHP+APC (or any other opcode cache) can match the performance of Java. There are two primary reasons for this:
include
-ing a lot of files and would benefit from storing them in memory.Hopefully this blog post will help make things clear: http://dow.ngra.de/2008/08/04/optimizing-ip2c-php-implementation/ I think the author gives PHP a bit of a bad rap, considering it really isn't made for heavy data processing duties but see his reply when someone complains at him for not using APC:
So, as far as the speed of code execution goes, an opcode cache is pretty-much irrelevant.
Here's a better set of language benchmarks. If you have time, you should learn a variety of languages (Java, C/C++, C# etc.) so you can employ the one best suited to the task at hand.
a Padded Cell our articles site!
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.