Announcement

Collapse
No announcement yet.

Codon Looks Very Promising For Super-Fast Python Code

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

  • Codon Looks Very Promising For Super-Fast Python Code

    Phoronix: Codon Looks Very Promising For Super-Fast Python Code

    While there is Pyston, PyPy, and various other alternative Python implementations being done in the name of performance, Codon is one of the newer ones and is talking up 10~100x faster performance...

    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
    Never heard of that license before. Is it open source? Can't find it on https://opensource.org/licenses/... Suspicious...

    Comment


    • #3
      Python code cannot be super-fast. The best it can achieve is avoid being sluggish-slow.

      Comment


      • #4
        Originally posted by marios View Post
        Python code cannot be super-fast. The best it can achieve is avoid being sluggish-slow.
        Wrong. If you compile it to native machine code it can be as fast as every other language.

        Codon is a Python compiler.

        Comment


        • #5
          Originally posted by slalomsk8er View Post

          Wrong. If you compile it to native machine code it can be as fast as every other language.

          Codon is a Python compiler.
          It stated clearly that it is not pure python. Also, building a compiler, albeit necessary, is not enough. For some languages, extra runtime overhead is necessary, even if you compile it. For example dynamic typing requires some extra state and automatic memory management requires reference counting and/or garbage collection.

          Comment


          • #6
            Originally posted by slalomsk8er View Post

            Wrong. If you compile it to native machine code it can be as fast as every other language.

            Codon is a Python compiler.
            The best compiler in the world can't make up for how Python completely destroys caches and prefetchers by indirecting literally everything

            Comment


            • #7
              Python 3.11 already got much faster, and Python 3.12 is likely to further bring some performance improvements.

              Python has its strengths and maybe it doesn't need to be so fast, it is still valuable for other reasons.

              Python also has its weaknesses:
              • Functions are declared using the def keyword instead of fn, fun, func or function.
              • There is no static keyword, so static class variables have an implicit semantics that isn't obvious and can be rather confusing.
              • It has the weird "walrus operator" which no other language have and is highly unfamiliar to most people.
              • It has its own vanity license.
              • It is difficult to embed into another application.
                • If executing Python code from within a Python application that code will have complete access to all of the application.
                • It is not possible to limit things such as file system access, network access, etc.

              Comment


              • #8
                It should be interesting for benchmarking Codon against Python 3.11 considering its recent upstream performance optimizations as well as seeing how it stacks up against some of the other performance-optimized Python implementations.
                If only there was person that regularly do similar benchmarks and was able to do the same in this case.
                But alas, world is not fair...
                RBEU #1000000000 - Registered Bad English User

                Comment


                • #9
                  Originally posted by slalomsk8er View Post

                  Wrong. If you compile it to native machine code it can be as fast as every other language.

                  Codon is a Python compiler.
                  Will the compilation myth ever die?

                  Python IS compiled. Look in your execution folder for .pyc files (usually under __pycache__). Those are python bytecode files, the result of a IR compilation of previous runs.

                  Compare the execution of .pyc files with a similar algorithm running through the JVM of Java. The difference can be easily one or two orders of magnitude.

                  The real difference between AOT compilation and JIT compilation is usually O(1), as numerous languages implementation have proven. Python is slow because even adding two ints requires a fairly complex call stack.

                  Lots of optimizarions can be done to CPython because performance was never a priority goal. However, at the end of the day, there is not enough information to map scripts to efficient Assembly instructions.
                  Last edited by sabian2008; 17 March 2023, 08:03 AM.

                  Comment


                  • #10
                    Originally posted by Vorpal View Post
                    Never heard of that license before. Is it open source? Can't find it on https://opensource.org/licenses/... Suspicious...
                    No, it isn't. The MariaDB company created it for proprietary add-ons to their open-core product.

                    Comment

                    Working...
                    X