Is there an experience one here who can tell us about PHP/ASP.NET/Ruby performance, which of these faster in rendering the websites assuming a very similar conditions and evironments?
I donโt have any numbers but performance is probably not the best reason to choose a language. For instance, using plain HTML is going to always be faster but youโre very limited on what it can do.
Choose a language based on: stability, feature set, learning curve, available resources, ease of debugging, etc. For most applications, performance should be quite low in the list of priorities.
If you do benchmark them, youโll likely find that for most tasks they are within 5% of each other and some are faster at some things than others.
This thread will probably grow fast. There are just so many variables involved. First of all, it depends on version of php and wheather or not you going to use APC cache, which is standard with 5.3
Generally, the compiled program is faster than scripted like php, but with APC cache the script is compiled on its first request then it is stored in memory already compiled for all future requests. This makes php scripts performed similar to compiled program like Java.
As far as ASP or Ruby there is probably not much difference. What would be faster is Java. The reason for that is Java knows the variables types in advance while php always has to guess the type of variable depending on what it has to do with it.
Also if Java programmer is really a pro and knows how to take advantage of multitasking then a program that uses multi threading (when written correctly) will always outperform a program that can do only one operation at a time sequentially.
Web programs rarely need the power of multitasking, but if they really calculate complex data, then yes, multitasking can help. For example, you may have a web program that need to call several different APIs (sort sort of mashup), get data from all of then and then assemble the page. In php you can only request/process one API call at a time, where in Java you can call/process several API calls seemingly simultaneously.
In short, php is pretty fast when you use APC because it pre-loads and pre-compiles your scripts once then serves them from memory. Typed languages like Java are always faster because variable type is known to the program in advance so it knows exactly how much memory to allocate. But usually we are still talking nanoseconds, maybe a couple milliseconds difference, certainly not noticable to end user. The only time it will make a difference if when you serve millions of requests a minute.
The only real gain in processing speed is when you use multitasking, but writing multithreaded programs is hard, easy to make mistakes that will result in degraded performance rather than improving it. You must really be professional programmer to do this right.