Announcement

Collapse
No announcement yet.

Python 3.11 Is Much Faster, But Pyston & PyPy Still Show Advantages

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Python 3.11 Is Much Faster, But Pyston & PyPy Still Show Advantages

    Phoronix: Python 3.11 Is Much Faster, But Pyston & PyPy Still Show Advantages

    There was much interest in the recent Python 3.11 beta benchmarks showing much performance uplift from this in-development version of Python compared to prior 3.x releases. While Python 3.11 performance is looking great and huge advantages compared to prior versions, there are also alternative Python implementations like PyPy and Pyston. Stemming from Phoronix reader requests, here are benchmarks showing how Python 3.11 beta performance compares to those alternative Python implementations.

    Phoronix, Linux Hardware Reviews, Linux hardware benchmarks, Linux server benchmarks, Linux benchmarking, Desktop Linux, Linux performance, Open Source graphics, Linux How To, Ubuntu benchmarks, Ubuntu hardware, Phoronix Test Suite

  • #2
    I know nothing of these other implementations but why wouldn't C be the fastest implementation, nothing is faster than C code other than hand optimized assembly language by an expert. What are these other language versions doing to beat C?

    Comment


    • #3
      Because JIT can (and do) cheat. Executing different optimized code, than you written, instead of interpreter, which have to interpret exactly.

      Comment


      • #4
        Originally posted by kylew77 View Post
        I know nothing of these other implementations but why wouldn't C be the fastest implementation, nothing is faster than C code other than hand optimized assembly language by an expert. What are these other language versions doing to beat C?
        A C interpreter could be faster than a <whatever> interpreter, but those JIT the actual Python code so Python executes natively rather than being interpreted AFAIR.

        Comment


        • #5
          Originally posted by Ilfirin View Post
          Because JIT can (and do) cheat. Executing different optimized code, than you written, instead of interpreter, which have to interpret exactly.
          "Cheat" has negative implications. JIT is as much cheating as picking a compiled language is cheating.

          Comment


          • #6
            Oh, I am so sorry, did I offend the JIT?

            Comment


            • #7
              I would also have liked to see Cython in this comparison.

              Comment


              • #8
                FYI there is another python runtime on the block: https://www.graalvm.org/22.1/reference-manual/python/

                Not sure how limited it actually is compared to the other runtimes.

                Comment


                • #9
                  Originally posted by Lycanthropist View Post
                  I would also have liked to see Cython in this comparison.
                  Cython requires special annotation to the types so that it can compile python code to efficient C code.
                  Otherwise it would just compile the python bytecode to some equivalent C code, which enables almost no optimization and performs the same as CPython.

                  Some of the packages that uses Cython includes pandas, but it has a lot of annotations, so comparing the general performance of Cython with other interpreters in meaningless.

                  Comment


                  • #10
                    Originally posted by kylew77 View Post
                    I know nothing of these other implementations but why wouldn't C be the fastest implementation, nothing is faster than C code other than hand optimized assembly language by an expert. What are these other language versions doing to beat C?
                    nope. software engineering and architecture are much more important than the language you pick. Many low latency, high availability systems you use on your daily basis are running on less than ideal languages.
                    One issue that constantly arises is to compare two diferent languages running the same algorithm, while in practice each language has different algorithms that make the most of it, even when solving the same problems. And it's even more common to see languages that are a great fit to solve some problems, but terrible to solve others. And that's fine. Each one has their strengths and reasons to be popular

                    Comment

                    Working...
                    X