Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Which is faster: PHP,Perl,Python,Java?

Hello all,

I think the question is pretty clear. Just to specify that it's about development of web sites, not some local use.

Please answer if you have experience with at least 2 of these platforms and can compare them from your experience.

Web links to bench tests would be appreciated too, if they are out of the platform developers networks.

Thank you in advance!

Update:

After I received the first answers I feel that I have to add this:

It is not just about to make a web site, but a bit critical piece of code.

For instance: A web page which gets some post data and produces PDF files online. I need it to as fast as it could be, but I am limited to these 4. I can't make my own C or whatever else application.

Thank you again.

9 Answers

Relevance
  • 1 decade ago
    Favorite Answer

    Trying to find which is the "fastest" can only be done by identical experiments:

    - You write a piece of code in all languages, with the SAME source (input) and objective (output).

    - Make this in a repeat loop (for/next) to multiply the length.

    - Start a timer at the beginning of the program,

    - Stop it when the program has completed its work.

    - Get the total time.

    - Compare performances with the other languages.

    It seems evident to say this, but EACH language has its own fast and slow processes, and finding the "fastest" is really a question of WHAT you are doing!

    You also have to take care of each CALL you make:

    In PhP, two or three similar functions would give you the same answer, but some take longer to execute (sometimes 20 times longer!) By just using a different function, you can make your code much faster!

    Finally, it also depends on your server. Should your server be running Windows, you WILL BE SLOW, at least 15 times slower than Unix/Linux based servers... But, again, depends on the objective: what is 10ms delay compared to 150ms? Not much! Do this 1000 times, that is 10 sec compared to 2.5 minutes: this becomes important.

    By experience, I would say PhP, but, again, it greatly depends on the application. (PhP has a lot of functions to convert/decode PDF files - an advantage, but some of the functions are slow).

    By experience, ASP, JSP, javascript are sloooooow.

    By experience, Compiled Java (NOT javascript) is usually pretty fast.

    Trial and error is the best (and only real) advice I can give.

    Source(s): Pro in most of them.
  • Andy T
    Lv 7
    1 decade ago

    That Gus guy obviously high on drugs and BS'ing as if he knew this.

    Of the four, Perl would be slowest because it is interpreted. Period, the old book I have says Perl 5 is experiment with compilation but not ready.

    PHP is interpreted I think, ASP Classic would be among the slower ranks because interpreted stuff.

    Java and ASP.NET are compiled hence faster, but Java is not absolute in speed.

    Python is also using the same compilation process as Java and .NET but I have no idea if Python/CGI is really fast I never even seen it.

  • 1 decade ago

    Actively developed, good support and quite some good speed results with PHP. PERL will win on some isolated cases (dedicated usage, etc).

    Depends all in what you're after, for overall dynamic serving, PHP will be your best friend. If you want true speed, go write your own module in Assembly, use SIMD extensions, etc....

    In any case, make sure your web-server is running PHP, etc, as an extension and not through the cgi-gateway, because the biggest slow-down comes at the server-module interfacing.

    Anyway, Please elaborate if you need a better answer, your question is just too generic to be properly answered, if anyone just said "this scripting language is the best for you" they'll be lying and obviously wouldn't have anything to back it on, because every case is different, the right tool for your job might just not be what other's think out of their previous (or only) experiences.

    Beware of javaists, it is said that they were brain-washed somewhere in 1990 :)

    Cheers.

  • 1 decade ago

    Hi,

    I recommend PHP .

    PHP's strength are :

    * PHP is the most superior technology. Other technologies PERL, Python, Tcl, VB script, ASP are older and inferior technologies. Even Java/JSP is inferior to PHP.

    * Open source

    * Easily learned syntax

    * Broad database connectivity

    * Massive library of contributed extensions

    * General purpose scripting language much superior to PERL, VB script, ASP, JSP.

    Why PHP ? PHP is the best because of the following reasons:

    * PERL is the "ancestor" of PHP and PERL is used for a very long time (more than 25 years old?). PHP has an advantage over PERL - PHP supports client-side code and is easier to compile into a executable. User base of PERL is very large. PHP tries to imitate PERL and complement the PERL technology. PERL programmers like PHP! PHP is actually a "modern PERL", but with a different name called "PHP".

    * Java is object-oriented but is very SLOW. Java programs run very slow. Also Java is immensely complex and sophosticated technology (has many layers like JVM, JIT compiler and others). And complexity and sophostication leads to problems. If there is Linux on server-side then why do you need Java in servers ? And Java is more like a system programming language and it is faster to develop in scripting languages (like PHP).

    * Python is "good" but there are no C like brackets/braces which are useful for code navigation in vi editor. It is like your hand is broken if you cannot navigate rapidly the source code using vi/emacs editor's seek braces/brackets commands. PHP is technologically more advanced than Python.

    * PHP is the best because it is object oriented and has the best features of C/C++/Java/PERL/Python. It can replace PERL, Python, Java, C, C++, awk, Unix shell scripting, MS Visual Basic and others!! PHP runs direct and PHP is written in C.

    * Each and every computer programmer knows why PHP is the best. Ask your nearby computer programmer.

    * Only PHP will prevail in the 21st and 22nd century and beyond!

    * Why do think every PERL, Python and Java programmers are flocking to PHP ?? There is a very strong reason.

    * Every person in the world wants PHP. PHP blast is causing shock-waves around the world!!

    * The world is dominated by PHP. There is PHP everywhere and anywhere...

  • How do you think about the answers? You can sign in to vote the answer.
  • 1 decade ago

    performance wise, there's usually no difference.

    here are some benchmarks:

    http://dada.perl.it/shootout/

    But anyway, the question is not which of the languages is faster. The question is: which language provides a better framework to manipulate PDF files? Creating/manipulating PDF files will be your main bottleneck, so you should concentrate on this. Do some research for the possibilities of each framework, and maybe write a benchmark. Then you have some real numbers.

  • Anonymous
    1 decade ago

    Just use whatever u find easier to use and learn.. There is not going to be a huge difference in speed... Anything will do as long as you are not developing some critical systems... If you just want a website, anything will do... I personally use PHP..

  • Anonymous
    1 decade ago

    Site Rubix is for anyone that builds, needs to build, or would like to build a website. If you are an Internet marketer, you will be able to whip together professional web pages in no time. If you own a business, now you can easily create a site and have a place where you can manage your media and regularly update your web pages. If you want to make money building sites or simply want to be able to build sites in a timely manner, Site Rubix can help you out. Basically, anyone that wants to create a website for their own purposes, to sell, or for clients, Site Rubix is your answer.

    If you think it will answer your question, try http://siterubix.incomestarters.com/

  • Anonymous
    5 years ago

    Well.... many refer to motorbikes (motorcycles) as Iron horses. I would have a hard time choosing between a fast motorbike and a live, fast horse. Cars are too confining.

  • 1 decade ago

    java because it has the highest and fastest working rate of all

Still have questions? Get your answers by asking now.