Hi; I want to know which language either php an interpreted language or Asp.net a compiled language to be adopted in the following scenario for better performance and why? Scenario: A business to business portal has to be made which will face 10,000+ users per hour traffic.
The people at Facebook use HipHop for PHP which converts PHP code into C++ code, making it extremely fast.
Usually languages such as C/C++ are faster than others because they compile right down to assembly code. So I would choose one of those.
Hard question, not much information... by the books ASP.net compiled language will give you a small boost on performance rather than an interpreted language like old asp, php, etc.
The reason behind that is that compiled languages are quicker as they have already compiled everything versus a php page that has to be read and compiled on the fly. But PHP has also some tricks to improve speed by compiling it...
At the end the speed of ASP.NET and PHP should be the same.
So this shouldn't be your main issue. You should have to focus instead on:
Having an scalable web site that allows you to have several web servers in a cluster to allow your site to handle all the users
Trying not to use session variables if possible to make easier the cluster
- DB stuff
- Price (if you are going to need a cluster of 5 web servers and 3 DB Servers, 5 Linux, 5 Apaches & 5 Postgres licenses are really less expensive than 7 Windows 2003 Servers + 3 SQLServer 2008)
The speed of ASP.NET, Java and PHP (with accelerator such as APC or eAccelerator) are comparable. You will not see a big performance difference between them.
There are other factors that influence performance much more than programming language, such as your data model, your database and the algorithms you use.
There are other factors to consider when choosing a programming language. ASP.NET and Java both have a good standard library, where PHP is inconsistent and not fully object oriented.
Performance is sometimes a complex topic, in a way that it might involve a number of tasks whose net/mean performance will determine your application's overall performance.
For example, if you break a large task into smaller ones, then the performance of the small tasks will affect the overall performance. Small tasks running in a separate thread of execution are not possible with PHP, so you cannot GET better performance this way.
PHP without the use of external libraries, will not allow you to optimize performance. From personal experience, and after some research it was clear that PHP could not meet the requirements for a high performance application, I had to develop. In a similar case, i found people having switched to java or .net for this.
In other words, PHP has it's pros and cons when it comes to specific topics such as performance. Be sure to understand the limitations of the language and runtime (if any) you are using before making any conclusions on it's ability to provide performance optimization.
Compiled code will be faster, but for this particular case PHP extensions can leverage the performance loss.
As said before me, other ways exists on boosting performance but some involve the compilation of your PHP code. Would you trust HipHop PHP for a large scale PHP application without looking out for stability, compatibility and other issues with the LAMP stack?