Announcement

Collapse
No announcement yet.

Python 3.11 Performance Benchmarks Show Huge Improvement

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

  • #11
    Originally posted by RahulSundaram View Post

    It might feel that way if you haven't looked beyond Mypy. Pyre or Pyright are significantly better. In particular, you can take any codebase you don't have types on and run pyre infer -i​, get types automatically and go from there.
    Great tip!

    Comment


    • #12
      I don't know which other mainstream or popular program uses it.
      Other popular programs (In my world) is FreeCad and InkScape.

      As pointed out above, also used a lot on SBCs and micro controllers. Python on Linux Raspberry PIs, MicroPython or CircuitPython on other controllers. In fact the simulated Star Trek computer (from Original Series) that I built has two boards in in. A RPI4 talking to a Grand Central M4 Express. Python being the language used on both boards.

      Here is the popular IEEE programmming Language chart for 2022 if anyone cares.
      Last edited by rclark; 25 October 2022, 09:03 PM.

      Comment


      • #13
        Gentoo users will also be happy to have faster dependency calculation with emerge.

        Comment


        • #14
          Originally posted by Danny3 View Post
          Nice performance improvemetns!
          But outside of Qbittorrent that uses Python for the search engine I don't know which other mainstream or popular program uses it.
          You can write scripts in Python for Scribus. In fact that's the only way to add an odd number of pages in a document and have the existing text and pictures change from left oriented to right oriented and vice versa. Also, afaik it's the recommended macro language for LibreOffice. No idea if extensions for it are also written in Python.

          Comment


          • #15
            I wonder how much closer this brings Python 3 to, for example, fairly unoptimized Rust code.

            Not intended as a sarcastic comment - I know any compiled language will be way faster, just curious.

            Comment


            • #16
              What about memory usage? Does this version use more memory as a trade-off for faster algorithms? I remember that memory usage between (IIRC) 3.6-3.7 increased by about 30%. This can suck on lower end machines like SBCs.

              Comment


              • #17
                Originally posted by binarybanana View Post
                What about memory usage? Does this version use more memory as a trade-off for faster algorithms? I remember that memory usage between (IIRC) 3.6-3.7 increased by about 30%. This can suck on lower end machines like SBCs.
                Reading through the details of how the performance improvements were accomplished, it looks like this all should reduce both memory and cpu consumption. This is all new work associated with the 3 person team that is being run by Microsoft which includes Guido exclusively to work on performance improvements over the next several releases.

                Comment


                • #18
                  Originally posted by hamishmb View Post
                  I wonder how much closer this brings Python 3 to, for example, fairly unoptimized Rust code.

                  Not intended as a sarcastic comment - I know any compiled language will be way faster, just curious.
                  Not always, but it is typical. The line between interpreted and compiled implementations a language is a lot more murky these days with the introduction of JIT (Just In Time) compilers and so forth. Python performance is being benchmarked against prior versions of itself, not against other languages like Rust which make very different tradeoffs focused on performance while Python is designed to a dynamic language which is inherently expected to always have a performance penalty even with gradual typing. So I wouldn't expect that delta to disappear. Having said that, if you are running say an animation renderer using Python as a glue language or a web application using Python, having these performance improvements (which includes reduced memory consumption and better startup time) will be welcome.

                  Comment


                  • #19
                    Originally posted by atomsymbol

                    Just a note: Dynamic programming languages (LISP, Python; Java) can be much faster than statically compiled languages if the application's performance benefits from generating code at run-time.
                    You are mixing the terms. You mean just-in-time compilation (JIT). And the current CPython (which is the official implementation of the Python language), doesn’t have a JIT compiler. So you won’t get any optimized native code generated during run-time.

                    LISP also refers to a family of languages, not a specific one. Not all LISP dialects have a JIT compiler either. Closure is a famous LISP dialect that runs on the JVM, so it does have JIT compilation.

                    Comment


                    • #20
                      Originally posted by atomsymbol

                      I do not mean JIT in this case. I mean: code generated by the software developer.

                      Code:
                      $ python
                      >>> a="1+2"
                      >>> eval(a)
                      3
                      But directly interpreted code will be always be orders of magnitude slower than just executing already compiled machine code, since you are dynamically generating instructions as your code is being executed. Even if your dynamically generated code is super specific for a single case, its execution will always be slow.

                      JIT solves part of the issue, by generating machine code that will be optimized for the current usage profile. So only the first few runs will be slow. But the current Python implementation cannot do that.

                      Comment

                      Working...
                      X