Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
×
Python Open Source Programming

Pyston 2.1 Is Blowing Past Python 3 Performance (phoronix.com) 72

Camel Pilot writes: Pyston 2.1, a closed-source but faster and highly-compatible implementation of the Python programming language, significantly outperforms Python 3 in a variety of benchmarks. All the system details and benchmarks in full can be found over on OpenBenchmarking.org.
This discussion has been archived. No new comments can be posted.

Pyston 2.1 Is Blowing Past Python 3 Performance

Comments Filter:
  • by Shaitan ( 22585 ) on Monday January 25, 2021 @06:08PM (#60991048)

    Why would anyone close source a language?

    • Re:Why? (Score:5, Informative)

      by guruevi ( 827432 ) on Monday January 25, 2021 @06:09PM (#60991056)

      The language isn't closed source, the compilers are. Intel does this with C/C++, Borland Pascal and Microsoft BASIC and C# are all closed source languages.

      • by raymorris ( 2726007 ) on Monday January 25, 2021 @06:25PM (#60991108) Journal

        Microsoft's compiler for C# is open.
        It's part of the .Net Core repo.
        https://github.com/dotnet/core [github.com]

        C# is an ECMA standard, like JavaScript, and is also an ISP standard.

        You'll also find the Visual Basic toolchain there.

        Microsoft Basic ended a couple decades ago.
        They've open sourced one of many versions.
        https://github.com/microsoft/G... [github.com]

        As to the Borland product, that does seem to be closed.
        I think they switched to Delphi about 25 years ago.
        Delphi was based on Turbo Pascal, which I think was based on Object Pascal, which was based on Pascal.

        • by dryeo ( 100693 )

          Turbo Pascal (CPM) came before Object Pascal (Apple Lisa), which you're probably confusing with Borland Pascal (DOS, Win3.x), which started out as rebranded Turbo with objects and grew into Delphi, and borrowed from UCSD Pascal (PDP11).

          • Thanks for that. The Pascal family of languages were in my peripheral vision during that time.

            I decided to learn VB6 rather than Delphi. I've wondered what I would have learned differently from what I learned doing VB6. From VB6 I first learned to really appreciate objects, I finally really understood WHY use them. I also got to learn about the Win32 API writing low-level hacks to access Windows functions that were officially not available from VB.

            Perl lays objects bare; the objects are naked so you can ea

            • I loved Delphi for two reasons. One, it was FAST. Secondly, it compiled true stand-alone .EXE files, didn't need those garbage vbrunxxx.dll files to go with it. I wrote some semi-commercial software with it back in the day, and it was a great tool for its time.
              • Man I loved Delphi back in the day. It was orders of magnitude superior to Visual Basic. And the speed and compile file size were excellent yes but also fantastic was that it came with a boatload of useful UI widgets.

                • by c600g ( 30798 )

                  Lazarus (https://www.lazarus-ide.org/ - IDE and GUI tools) and Free Pascal (https://www.freepascal.org/ - object pascal compiler and RTL) are the open source, multiplatform equivalents today.

            • by dryeo ( 100693 )

              I'm not a programmer and never used VB besides chasing after the runtime too often. Pascal did teach me about structured programming and the benefits of strong typing. Perhaps if I'd been exposed to computers 20 years earlier, I would have grokked objects quicker.

              • > Perhaps if I'd been exposed to computers 20 years earlier, I would have grokked objects quicker.

                For me, building a GUI is what made objects "pop".
                A password field and a calendar picker DO things (methods), have properties, and respond to things happening, such as clicks. It's natural to think of them as objects, to wrap up their behavior, properties, and events together to represent a password field as a "thing".

                Single line text input, multline text input, and password field all have a lot of common p

                • by dryeo ( 100693 )

                  Yea, dealing with OS/2's WorkPlaceShell helped a lot with my understanding objects as everything is an object with that GUI. Desktop is of class folder. Someone even wrote a CD player and media player descended from the folder class and I've inherited maintenance of the screen saver which is descended from the lockup class.
                  Windows COM is basically a bad (but maintained) implementation of IBM's SOM.

                  • I had started to add, I learned from other languages why not EVERYTHING should be an object. Not everything takes actions, has useful properties, and useful events.

                    I prefer:
                    seconds_day = 24 * 60 * 60

                    Over:
                    seconds_day.setValue(24.mutiply(60.multiply(60.value).value))

      • Only problem with closed source stuff is they want to steer you to their platform. As long as Pyston 2.1 is completely compatible it's just a complier.

        • by AleRunner ( 4556245 ) on Monday January 25, 2021 @06:44PM (#60991204)

          It's "highly compatible" which means that it's not "fully compatible" which means you are going to hit something really weird and difficult when you try to port back. Fighting with weird compilers and their bugs can be some of the nastiest stuff going.

          The real python people have PyPy which kind of has the same problem but isn't closed and looks like it has better benchmarks [pypy.org] than piston, just from a brief compare of the line size on probably completely unrelated and incomparable benchmarks. I'd trust PyPy much more than a closed implementation. Also, if you do end up being forced to migrate back there's likely to be a bunch of other people with the same problem so you won't have to do it alone.

          • by Shaitan ( 22585 )

            Exactly, yes there are closed compilers in the world but they are artifacts of the past before open source methodology won the software wars.

            • by ceoyoyo ( 59147 )

              Except for all the Intel compilers, and all the special purpose compilers, sure.

              • by PCM2 ( 4486 )

                You could argue that Intel's compilers are "special purpose compilers," since their main selling point seems to be that they can exploit undocumented features of Intel chips.

                • For about five minutes, maybe. Even the obfuscated AARD code was unfucked by the authors of Undocumented DOS and brought up in the Digital Research lawsuit against Microsoft.
                • by dfghjk ( 711126 )

                  You could argue anything for the flimsiest of reasons. You can also argue that all compilers are special purpose. Software developers are "special purpose" computer users.

          • by ceoyoyo ( 59147 )

            There's also Cython, which will just translate your Python code to C and compile it into a library for you.

          • by gweihir ( 88907 )

            It's "highly compatible" which means that it's not "fully compatible"

            Yes, that is pretty much a red flag for me too.

            Also, if you have serious performance issues in Python, just embed C modules for the heavy lifting. It is not very difficult to do, real C skills stipulated.

          • It's "highly compatible" which means that it's not "fully compatible"

            You can probably say that about two different implementations of any language - C, C++, Javascript... There is never a non-buggy implementation (most bugs in common compilers are of course fixed but there will always be some rare corner case somewhere) which means that there will always be a behavior in one implementation that isn't the same as in another. Most languages are sufficiently complex that it is very hard to have 100% compatibility.

            You have to look at the details of what they mean by "highly comp

        • by Shaitan ( 22585 )

          It isn't though it is an embrace and extinguish platform. I thought we were more or less done with this particular flavor of fuckery.

        • by PCM2 ( 4486 )

          Only problem with closed source stuff is they want to steer you to their platform.

          That's the only problem with a closed source toolchain? Here you have a compiler that's claiming to be faster than the original, open source implementation. Aren't you even curious as to why it might be faster, and what shortcuts it might be taking to achieve those results? If you're paranoid, I'd also think you'd be curious about what kinds of code it tucks in there without telling you, perhaps to facilitate things like remote telemetry. And failing all of that, isn't a compiler that can easily be ported t

      • by Shaitan ( 22585 )

        Technically sure but why would anyone take a blast to the past and close source a compiler TODAY in a world in which the closed vs open battle has solidly been won by open.

    • by gweihir ( 88907 )

      Why would anyone close source a language?

      To make money. Tons of money. And when enough people have moved, extend and extinguish the original.

      • To make money. Tons of money.

        Pyston 2.1 costs $0.

        It isn't easy to make money at that price point.

        • Re: (Score:3, Funny)

          by pbry4n ( 7208566 )
          They'll make up for it in volume.
        • by Shaitan ( 22585 )

          That is even worse.

        • Today it may be $0. If it takes off and becomes popular, people start coding for it, perhaps start using some Pyston-only features, then prices go up above $0. A free version may still exist, for personal use and perhaps limited to 72 runtime before requiring restart. Even if you stick with pure Python only, when faced with a decision of paying for closed source Python interpreter or using open source version which requires you to buy/rent more servers to accomplish the very same task, the math with dictat

        • What is the point of gratis closed-source software? Sounds extremely fishy to me. What's hiding in that code?

  • by Tablizer ( 95088 ) on Monday January 25, 2021 @06:13PM (#60991066) Journal

    You can now process twice as many white-spacing complaints per hour.

  • Fuck them (Score:5, Interesting)

    by backslashdot ( 95548 ) on Monday January 25, 2021 @06:13PM (#60991068)

    OK, its shitty of them to be closed source, that's a given. But also the version scheme is terrible. They shouldn't call it 2.1. It's confusing because it's not clear whether it requires Python 2. I mean it was a real pain for people to shift from 2.7 to 3 and now this thing reminds of that.

    • To make things even funnier it should work with both versions 2 and 3.

    • It's not shitty because it's allowed by the Python licence. People don't get to complain about others doing what the licence permits. Choose a better licence.
      • I mean I don't think we should be upset with them... simply don't use it. Nothing wrong with forking an open source project and making your own implimentation with some huge shitty drawback.... Open source allows forks with major flaws.... we're just supposed to ignore them when they suck, rather than waste so much time bringing up news about them. Complaining about the license allowing it, is like saying free speech sucks because people can badmouth good people.
  • While perhaps these are true benchmarks with real world scenarios, they may have simply tweaked the compiler to be more performant for these test cases. Also I have no doubt the Python teams could to more to make it faster :)
  • by Jeremi ( 14640 ) on Monday January 25, 2021 @06:14PM (#60991074) Homepage

    I'm not sure that "I need the best performance possible" is a good fit with "I want to implement this in Python". Better to use a compiled language for the high-performance routines, instead?

    • by Sloppy ( 14984 )

      Yeah, but you know how it really goes. "I already wrote this thing, and now I want it to run faster."

    • by caseih ( 160668 ) on Monday January 25, 2021 @08:48PM (#60991540)

      Of course. But Python is a great glue language. That's why high performance computing uses Python a lot, combined with high performance, compiled libraries for use from within Python. If you happen to like Python, which I do, Cython works quite well as a means of compiling for speed certain performance-sensitive routines. In many respects you end up with the best of both worlds. Given these facts, I don't see a lot of use for this proprietary implementation in the high-performance computing genre. But I could see it used on the web server, to get more performance out of django, for example.

      • I agree that python is a great glue language. I have some code that extensively uses numpy and many other high performance libraries. Python also has tools like numba if you need to speed up something not already available in a low level language. I worked in some code yesterday and half the performance of my program was in a single function about 10 loc long. I rewrote that function using numba and doubled the performance of my program.

    • by PCM2 ( 4486 )

      I'm not sure that "I need the best performance possible" is a good fit with "I want to implement this in Python". Better to use a compiled language for the high-performance routines, instead?

      Tell it to Facebook, which in its wisdom decided the best way to scale its service was to reimplement PHP from scratch.

    • by gweihir ( 88907 )

      Pretty much so. Or use Python as Glue and for parts that are not performance critical and embedded C modules for the heavy lifting. I made pretty good experiences with that.

    • by Seirdy ( 7677976 )

      It's common for orgs to think "developer time is more important than cpu time".

      Then they get a bunch of users and realize that they have to scale. With technical debt in the form of potentially millions of lines of Python, they have two option:

      1. Re-write everything in something else
      2. Swap out the interpreter and just re-write some parts that use libs iwth C-extensions.

      Sometimes, the latter is the cheaper option.

      Of course, the whole mess could have been avoided if they thought in the long-term a bit more.

  • by ffkom ( 3519199 ) on Monday January 25, 2021 @06:14PM (#60991076)
    The CPython interpreter is known not to be the fastest possibility to execute Python code. If performance is of importance, a comparison to the much faster pypy or cython would be much more relevant.
    • by godrik ( 1287354 )

      last time I tried pypy and cython, there were pretty annoying compatibility issues with the reference python interpretor. Maybe they are fixed now. Maybe pyston has the same problems.

      • I recently adapted a large Python codebase to work on Pypy. But "adapted" isn't really the right word, because pretty much everything just worked the first time. There was one very minor issue I had to deal with from a small difference in behavior, but that was it. If you haven't tried it in a while, it's probably worth taking another look.

  • by oldgraybeard ( 2939809 ) on Monday January 25, 2021 @06:38PM (#60991182)
    the most pertinent "closed-source"! Thus I won't use it or care, if I don't have to. And I don't have to ;)
    • Yeah, stay away from this. There's no reason to use it.

    • I expect Pyston to announce that Python contains Pyston's precious intellectual property and every Python user must pony up a $600 site license. It's happened before.

  • seems strange that a compiler is sometimes losing to an interpreted language.
    • by Entrope ( 68843 )

      Not so strange. Two benchmarks are slower: python_startup and json_loads. Pyston is a JIT, so it's not surprising that startup would be slower. I would guess that json_loads spends almost all its time in native C code, so there just isn't that much Python runtime to speed up.

      • Would be a silly benchmark if it ran for such a short period that meant any sort of startup or init could overshadow the actual processing time.
        • I wouldn't assume it is all that silly. There are definitely use-cases for small programs running short jobs (following the basic Unix philosophy) and startup time might be the dominate time in running such programs, meaning that you might care about a benchmark that tests startup times.

          • Of course there are examples and requirements for super fast start and stop programs, but thats hardly a worthy benchmark thats hardly measuring the compiler or jit.
            • I think you're dismissing a use-case that you aren't much interested in. A "worthy" benchmark is a benchmark that somebody cares about - and there are real (and rather common) use cases for short-running programs. Of course that particular benchmark may show a Python JIT compiler at a disadvantage compared to pre-compiled or plain interpreted - but this is good to know about if your application is this style of program. And again, most of the basic Unix programs fall into this category - so there are a whol

  • I have written a handful of interpreter languages. There is not much prohibiting Python from being a fast running. It's just another one of those things for which, for whatever reason, nobody has stepped up to the plate. Personally, I think it's just because it feels and seems in so many ways like a toy language. I think it gained popularity because it's pretty good at presenting academic example cases and then, later, due to all the data science and machine learning libraries for it (which I use on a d

    • There is not much prohibiting Python from being a fast running. It's just another one of those things for which, for whatever reason, nobody has stepped up to the plate.

      They already did. Pypy is a well supported, highly compatible, JIT enabled, open source Python engine. It's still slow compared to statically typed languages, but it's a lot faster than CPython.

      • by Zappy ( 7013 )

        They already did. Pypy is a well supported, highly compatible, JIT enabled, open source Python engine. It's still slow compared to statically typed languages, but it's a lot faster than CPython.

        Python is very statically typed, more so than any other language. There is only one type, "pointer to an object". What makes compiling/speed-up tough are the mutable objects. You can add/change methods and properties after an object is instantiated.

    • by pjt33 ( 739471 )

      JavaScript already supports data structures compatible with Python but much more versatile.

      It doesn't seem to support tuples - I can find a proposal among the ECMA's GitHub repos, but it's clearly very much a work in progress: an issue to allow ordering comparisons [github.com] was opened only two days ago. Or are you proposing that JS Arrays are compatible with tuples but more versatile? If so, I'm dubious: aside from ordering, there's also the critical distinction that tuples are immutable.

      FWIW I would also consider h

  • "binary-only" ?
    WTF?
    Why are Phoronix using those weasel words for Closed Source ?

  • to post this bs article?
  • What is the use-case for a closed source version of an open-source language that already has a multitude of easy ways to increase performance from pypy/cython to gpu compatible libraries.

What is research but a blind date with knowledge? -- Will Harvey

Working...