filmov
tv
Why PHP is Faster than Java

Показать описание
Do you know why PHP is faster than Java?
In theory, Java is faster. PHP is loaded and re-interpreted every time you run it unless you use a Zend optimizer.
In theory, there is no difference between theory and reality. In reality, there is.
In reality, PHP runs a little faster and uses fewer resources to boot.
Why the discrepancy?
PHP programmers are aiming for short, straight, simple processing. You get faster, more efficient code as a result.
I thought computing power would matter more than the code.
Writing good code will do more to improve an application's speed than the server it runs on. The data structures and algorithms will slow things down immensely if poorly designed.
And Java applets and virtual machine initialization can slow down website generation and loading.
PHP is not perfect. PHP makes it hard to cache data in a live instance.
It sounds like I should be working with PHP.
Each language has their strong points, and for PHP, that's server support and maintenance. But PHP development is almost always faster than Java development.
Why would PHP development be faster? There are fewer code libraries for it and not nearly as many third party tools to test and debug it.
Java developing can take a long time, given that you have to repackage, redeploy and retest as you go along.
That's almost as painful as deploying a full application.
And then there are the Java embedded apps within applications in other languages, layers within layers that can slow you down.
So PHP wins on speed because it is less complicated.
Oh, I'm sure there is a PHP developer who made something somewhere insanely complicated.
That risk exists anywhere someone has a customizable application.
And there is someone running an Opera browser on a BSD OS, but that doesn't mean the rest of us have to worry about it. Just focus on efficient and bug-free code and you'll get a faster app no matter what language you code in.
In theory, Java is faster. PHP is loaded and re-interpreted every time you run it unless you use a Zend optimizer.
In theory, there is no difference between theory and reality. In reality, there is.
In reality, PHP runs a little faster and uses fewer resources to boot.
Why the discrepancy?
PHP programmers are aiming for short, straight, simple processing. You get faster, more efficient code as a result.
I thought computing power would matter more than the code.
Writing good code will do more to improve an application's speed than the server it runs on. The data structures and algorithms will slow things down immensely if poorly designed.
And Java applets and virtual machine initialization can slow down website generation and loading.
PHP is not perfect. PHP makes it hard to cache data in a live instance.
It sounds like I should be working with PHP.
Each language has their strong points, and for PHP, that's server support and maintenance. But PHP development is almost always faster than Java development.
Why would PHP development be faster? There are fewer code libraries for it and not nearly as many third party tools to test and debug it.
Java developing can take a long time, given that you have to repackage, redeploy and retest as you go along.
That's almost as painful as deploying a full application.
And then there are the Java embedded apps within applications in other languages, layers within layers that can slow you down.
So PHP wins on speed because it is less complicated.
Oh, I'm sure there is a PHP developer who made something somewhere insanely complicated.
That risk exists anywhere someone has a customizable application.
And there is someone running an Opera browser on a BSD OS, but that doesn't mean the rest of us have to worry about it. Just focus on efficient and bug-free code and you'll get a faster app no matter what language you code in.
Комментарии