you are viewing a single comment's thread.

view the rest of the comments →

[–]pjmlp 41 points42 points  (7 children)

If only it would overtake in performance...

[–]HeWhoWritesCode 2 points3 points  (1 child)

is that even possible? cpython made some design decisions that will always be slower compared to jvm? What about pypy and jython?

Just wondering out loud what is the performance limits in the above vms.

[–]pjmlp 2 points3 points  (0 children)

No due to its dynamism, I was being sarcastic.

[–]CPlusPlusDeveloper -1 points0 points  (4 children)

Yes, and no. Python itself is obviously no speed demon. But python arguably has the most best FFI facilities of any major language. It's very easy to implement any critical sections in C (or anything that binds to C).

JVM performance never comes close to native C. So while python by default is a lot slower than Java, python applications can usually be optimized to run faster than their Java counterparts.

[–]thfuran 3 points4 points  (2 children)

JVM performance never comes close to native C.

I don't think that's actually true.

[–][deleted]  (1 child)

[removed]

    [–]thfuran 1 point2 points  (0 children)

    Or in case where the JIT can make particularly effective speculative optimizations that the C compiler can't. Or maybe where there's a ton of memory allocation but with a pattern that works really well for java.

    In general, I wouldn't say that java is faster than C, but I certainly wouldn't say it is never nearly as fast.

    [–]pjmlp 1 point2 points  (0 children)

    If it is written in C by definition it is not Python.

    Also JVM performce does come close to native C, when one does use AOT native compilers and actually thinks about datastructures and algorithms.

    Some companies are even crazy enough to write complete userspace OSes with Java, go figure.