Quote:
Originally Posted by microcolt
I know how to script in PHP, JAVA, CGI, and little ASP.
What code is the best to use if i want to load my webpages fast?
I dont have a lot of content on them but when you have like 2 pages of information with code that needs to be executed... well it might take a while on a Dialup connection or somthing slow?!
|
Great way to start a flame war 
But, I'll throw in my $0.02 anyway.
CGI will generally be slower because it involves starting a new process for each request. So, even if your CGI program was written in tight assembly, the latency of getting it started would hurt performance. Besides the limit for number of processes on a machine (hurting capacity).
As for the rest, good code in any language will be faster than bad code in any other language.
Java can poentially be the fastest out of the ones listed because of JIT (just in time compilation) converts the byte code to native code, and runtime optimization (code gets more optimized the more it is run). The cavet being, development is more difficult and complex.
ASP can be almost as fast as java if you write your logic in C# or C++, compile and drop in a DLL. Putting code in ASP pages (as most do) can be buggy and slow.
PHP (on med to small sized projects) can offer the fastest development but, performance isn't the best. However, you can compile your PHP to gain a major performance boost. Though very few hosting services offer a PHP compiler.
On a side note, that fact that a user may be on a dial-up doesn't really offer any relevance at all. The only thing to help a user on a slow connection is to send back less data. You server platform makes absolutely no difference here. The only possible way it could affect things is multiple slow concurrent users will require more threads on the server.
|