Re: Is python faster than java?

Discussion in 'Python' started by Emile van Sebille, Aug 23, 2009.

  1. On 8/23/2009 12:47 PM Raimond Garcia said...
    > I'm building a large application,


    What kind of application?

    > kind of fancy python but I'm concerned
    > about speed.


    Speed of what? Development? User interaction? Responsiveness to queries?
    Mostly, you should worry about speed later. Writing it in python is
    probably faster than java. Then optimize the slow bits once you've
    identified where its needed.

    Emile
     
    Emile van Sebille, Aug 23, 2009
    #1
    1. Advertising

  2. Emile van Sebille

    sturlamolden Guest

    On 23 Aug, 21:59, Emile van Sebille <> wrote:

    > Speed of what? Development? User interaction? Responsiveness to queries?



    My personal view on the 'Is Python faster than Java' question:

    - Coding? Yes, if you program 'pythonic'.

    - String handling? Often.

    - I/O and networking? Often.

    - Iteration? No.

    - Function calls and recursion? No.

    - Arithmetics with elemental types? No.

    - Numerics? Yes, if you use NumPy.

    Is never interesting which language generates the most efficient code.
    If that were the case, we would be writing everything in assembly. If
    the code is fast enough, it is fast enough. Fast enough is sufficient.

    If some part of the code turn out to be too slow, we have two options:
    Either we use faster hardware, which is often the cheapest solution.
    Or we can alternatively try to move that part to something less high-
    level (Cython, C, C++, Fortran, assembly). Unlike Java, Python
    integrates easily with C.

    Also beware that Python is not Java: There is an old saying that you
    can write FORTRAN in any language. You can also write Java in Python.
    It will be just as slow to program as Java, and it will run a lot
    slower than Java. Most of the complaints about 'Python being slow'
    stems from people writing Java in Python.
     
    sturlamolden, Aug 24, 2009
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    43
    Views:
    7,500
    Benji
    Nov 2, 2005
  2. Julie
    Replies:
    140
    Views:
    5,153
    George Neuner
    Jun 6, 2004
  3. Sanny
    Replies:
    12
    Views:
    601
    Andrew Thompson
    Dec 15, 2006
  4. David Segall
    Replies:
    2
    Views:
    465
    Thomas Kellerer
    Jan 2, 2007
  5. Rishi Boparai

    Java Faster Than C ?

    Rishi Boparai, Apr 1, 2008, in forum: Java
    Replies:
    23
    Views:
    1,071
    Martin Gregorie
    Jul 6, 2008
Loading...

Share This Page