News for hackers. Stuff that matters.
Re:Pyston v2: Faster Python by pwinnski on Wednesday October 28, 2020 @02:02PM (#24922039)
I feel like anybody really searching for speed is using something other than Python. I don't use Python for speed, but for ease-of-use.

It took me some clicks to see it's supposed to be a drop-in replacement, so that's good.

Re:Pyston v2: Faster Python by chrisseaton on Wednesday October 28, 2020 @02:44PM (#24922565)
> I don't use Python for speed, but for ease-of-use.

Right - but if you can get that with better performance that's good isn't it?

I don't get why people object to performance work on languages not intended for performance.

Re:Pyston v2: Faster Python by Narann on Wednesday October 28, 2020 @04:56PM (#24924042)
> I don't get why people object to performance work on languages not intended for performance.

You're right, this objection is not relevant in general.

But in the situation we talk about, having 20 % more performance requires you to choose a fork that can came with it's own limitation. It's definitely not free.

This trade of makes the point about the language choice relevant.

Re:Pyston v2: Faster Python by mhh__ on Wednesday October 28, 2020 @05:09PM (#24924183)
> I don't get why people object to performance work on languages not intended for performance

My gut feeling is that Python is just not safe or static enough to ever be worth trying to compete with (say) C++ with. Python sure is easy but I think the asymptotic cost of using it for a big project (in my hands at least) is just not worth it.

I like Python's syntax quite a bit but I feel bad watching people learn to program using it - partly because it's an oddly low-level language (It's closer to being C than Haskell) and there's no compiler to stop you shooting yourself in the foot (If I write something fundamentally unsound I want to know about it now not when the process has been running all day)

Re:Pyston v2: Faster Python by saluk on Wednesday October 28, 2020 @06:05PM (#24924640)
As someone who learned on python (many years ago), I think the balance of being allowed to shoot myself in the foot, while only having to learn complexity when complex concepts came up, was a good combination rather than a bad one. Trying to learn C++ and Java before, having to type everything was an impedement. On python, you find out that types still matter when you try to add a string to an integer, for example. The moment the type matters to you is when you need to dig into those details. I'm not sure I would have the career I do if it hadn't been around to be the one language that fit my 16-year old brain.
Re:Pyston v2: Faster Python by adrianN on Thursday October 29, 2020 @03:02AM (#24928005)
You don't have to compete with C++. If switching the interpreter allows you to save 20% server costs at ~0 development cost that's a no-brainer. Rewriting your stuff in C++ might allow you to save 95% of your server costs, but development cost is a lot higher.
Re:Pyston v2: Faster Python by omginternets on Wednesday October 28, 2020 @05:12PM (#24924207)
>I don't get why people object to performance work on languages not intended for performance.

It's simple, really. They're concerned about the trade-offs.

Re:Pyston v2: Faster Python by chrisseaton on Wednesday October 28, 2020 @05:13PM (#24924216)
If it's in a fork that you can pretend doesn't exist if you don't want it... what is the trade-off?
Re:Pyston v2: Faster Python by omginternets on Wednesday October 28, 2020 @05:47PM (#24924497)
A fragmented ecosystem, incompatibilities, etc.

And more importantly, your original question isn't asking about forks, specifically. It was asking why someone might oppose performance work.

Re:Pyston v2: Faster Python by chrisseaton on Wednesday October 28, 2020 @06:14PM (#24924713)
> incompatibilities, etc

But it's compatible. It's a drop-in replacement.

Re:Pyston v2: Faster Python by omginternets on Wednesday October 28, 2020 @07:11PM (#24925230)
Serious question: do you have experience with “drop in replacements” for reference implementations? They’re rarely 100% compatible. Especially when the reference implementation isn’t formally specified.

Moreover, you continue to cherry pick, neglecting the other arguments you’ve been presented. It sounds like you’ve already made up your mind about this.

Re:Pyston v2: Faster Python by chrisseaton on Wednesday October 28, 2020 @08:46PM (#24925873)
Other arguments are ‘it’s not worth it’ or ‘it’s not likely to succeed’ but nobody is making you do the work!
Re:Pyston v2: Faster Python by omginternets on Wednesday October 28, 2020 @09:05PM (#24925986)
Hmm no, they’re really not. I’ll leave you to reread the tread.
Re:Pyston v2: Faster Python by Shared404 on Wednesday October 28, 2020 @02:55PM (#24922701)
> I don't get why people object to performance work on languages not intended for performance.

Presumably because they see it as effort that could be better applied elsewhere.

I don't know that I agree, but I can understand the viewpoint.

Re:Pyston v2: Faster Python by kazinator on Wednesday October 28, 2020 @05:10PM (#24924190)
People object to changes in requirements and implementations that they don't control and don't perceive as being beneficial to their use case.
Re:Pyston v2: Faster Python by chrisseaton on Wednesday October 28, 2020 @05:22PM (#24924282)
But it's a fork. And what do you mean by 'requirements'? It's compatible. Forget it exists if you don't want it.
Re:Pyston v2: Faster Python by qorrect on Wednesday October 28, 2020 @02:19PM (#24922247)
I use python because of Numpy, Scikit and Tensorflow. I don't know of any other languages with libraries as productive as these, so speeding these apps up is a big win for a lot of people.

Also 20% is huge, I look forward to trying it!

Re:Pyston v2: Faster Python by hhas01 on Wednesday October 28, 2020 @03:30PM (#24923109)
20% faster is nothing. You want at least a magnitude faster to justify the cost and risk of switching.

The Python language is already 30 years old, and it wasn’t even the cutting-edge in imperative language design (<koff>Smalltalk, Lisp</koff>) back then. It’s positively antiquated now.

I’ve never understood this tunnel-vision obsession with endlessly chasing ever-diminishing returns. It’s Zawinski's Law of Software by way of Greenspun’s Tenth Rule, and a fundamental failure of courage.

Learn the lessons from both the good and bad of what’s been done before, and move on. A better long-term answer would be to design a much faster, more efficient language for running Numpy, Scikit, and Tensorflow, then port those libraries over to that. If that language turns out to be good for other things too, then great. If not, let a thousand flowers bloom.

There is a much larger learning opportunity here, to get a whole lot better at migrating extant code bases from an old, popular, dead-ended language to a new, upcoming one. But it’s like finding your way to Carnegie Hall: it takes practise, practise, practise.

Re:Pyston v2: Faster Python by attractivechaos on Wednesday October 28, 2020 @05:28PM (#24924336)
Interesting that you are down voted. I agree with you that 20% faster is really nothing in comparison to the many new languages. I was saddened by the path Python3 chose. If compatibility was already broken at the time, they should have designed something with performance in mind from the beginning. The V8 javascript engine was there. We knew things could get >10X faster with JIT. Python is too big to die, but it is an inferior programming language in many ways.
Re:Pyston v2: Faster Python by hhas01 on Wednesday October 28, 2020 @06:51PM (#24925085)
“Interesting that you are down voted.”

Doesn’t bother me; I’ve got points to spare.

What downvoters haven’t got, it seems, is any arguments.

Re:Pyston v2: Faster Python by mlyle on Thursday October 29, 2020 @07:20PM (#24937273)
> 20% faster is nothing. You want at least a magnitude faster to justify the cost and risk of switching.

Eh. If newer versions of cpython end up 20% faster, eventually most things will end up running on those newer versions. It may take years for almost everything to drift to newer versions, but there's a noticeable performance benefit we all realize over time.

> Learn the lessons from both the good and bad of what’s been done before, and move on. A better long-term answer would be to design a much faster, more efficient language for running Numpy, Scikit, and Tensorflow, then port those libraries over to that. If that language turns out to be good for other things too, then great. If not, let a thousand flowers bloom.

Python's great at running numpy, scikit, and tensorflow. It's not the bottleneck, because these are largely native libraries-- achieving something "much faster" and "more efficient" for this are doubtful.

The benefits of Python are that it A) has a huge ecosystem, B) it's relatively polished and expedient to write code in, and C) there's a ton of people who know it. These are not easy things to create somewhere else, and there's no guarantee that the set of tradeoffs you choose will leave you in a better place afterwards.

The biggest downside of Python is that if you want to get a lot of concurrency or performance for Python code (instead of things like numpy, scikit, and tensorflow), you get pushed into the edges of the Python ecosystem, where you only get a portion of A's advantage (but still largely realize B & C).

Re:Pyston v2: Faster Python by newen on Wednesday October 28, 2020 @04:12PM (#24923589)
I agree. Almost all arguments in favor of Python is about sunk cost. Not much about the actual language is appealing compared to modern languages.
Re:Pyston v2: Faster Python by dragonwriter on Wednesday October 28, 2020 @04:42PM (#24923900)
> Almost all arguments in favor of Python is about sunk cost.

I think you are confusing ecosystem and other established advantages with sunk costs, they are different things. It's true that (from the perspective of the people who built them), those advantages are the products of sunk costs, but the argument is about the ongoing value delivered, not the sunk cost involved in delivering it.

> Not much about the actual language is appealing compared to modern languages.

Even if that was true, many of the actual languages competing with Python are less modern by any measure, and in any case so what? Does it matter when choosing a langauge if an advantage is produced by the abstract design of a language, it's ecosystem, or the peculiarities of the available implementations? Advantages are advantages, value is value.

Sure, if you are considering how to promote a “modern” language against Python, it's important to distinguish whether your current barrier is the design of your language or Python’s ecosystem to know how to direct your efforts, but if you aren't a tool evangelist and instead are choosing a language for a project, I don't see that it matters why Python is a net advantage, as long as it is.

Re:Pyston v2: Faster Python by hhas01 on Wednesday October 28, 2020 @04:59PM (#24924083)
“the argument is about the ongoing value delivered”

Which is an admirable sentiment… but the title of this thread is not “Python: still doing useful work” but “Python: now 20% faster”, and being ridiculously self-congratulatory about this when the correct response is to laugh at the silly pointless frivolity of it.

Trying to make Python fast is a fool’s errand, because Python is slow by design.

A useful argument would be that Python is faster overall at solving various real-world problems than current alternatives; but that’s not the popular argument being made, because the population fixates on minutiae instead of overall perspective.

Re:Pyston v2: Faster Python by dragonwriter on Wednesday October 28, 2020 @07:32PM (#24925378)
> Which is an admirable sentiment… but the title of this thread is not “Python: still doing useful work” but “Python: now 20% faster”

No, it's actually, “Pyston v2: 20% faster Python". But...so what?

> and being ridiculously self-congratulatory about this when the correct response is to laugh at the silly pointless frivolity of it

For the same reasons Python is often a valuable choice, a faster Python is a valuable option.

> Trying to make Python fast is a fool’s errand, because Python is slow by design.

Python is not slow by design, though it's slow because it's not fast by design. But that doesn't mean it's not useful to have a faster Python, only that there are likely to be limits and trade-offs involved in doing that.

> A useful argument would be that Python is faster overall at solving various real-world problems than current alternatives; but that’s not the popular argument being made

Yes, actually, it is. It's not the message of the Pyston v2 release blog entry, but then that blog entry isn't making an argument in the debate that you seem to want everything to be about.

Re:Pyston v2: Faster Python by hhas01 on Thursday October 29, 2020 @06:04AM (#24928812)
“Python is not slow by design”

Everything in Python is late-bound, untyped, and mutable by default. Straight off the bat that’s three key design decisions that make for a slow interpreter. Defining numbers as heap objects, implementing structures as hash tables, and poor parallelization (<koff>GIL, dumb POSIX threading) are three more.

Sure, you can throw huge amounts of brains and resources at code analysis, opportunistic JIT, and the rest a-la V8, but at some point you have to say “Is this an effective use of those valuable resources?” Especially when every such optimization could potentially break existing, stable user code running in production.

..

But, let’s get back to larger perspective:

Faster overall takes into account not just the time it takes to run a user program, but also the time it takes to learn, implement, debug, and deploy. Only one of these is machine time, which these days is cheap as chips and nearly inexhaustable; all the rest are human labor, which is both expensive and limited.

Which is not to say that Python is faster at all those human tasks than other languages. To determine that would require real-world practical testing, plus a willingness to accept what those tests tell you (which might not be what you wanted to hear). But I’m willing to bet that the time spent on all those manual tasks vastly outweighs the time saved by 20% faster runtime for the vast majority of use cases.

So at some point you have to stop and ask: Are these fundamental changes adding genuine, measurable value for real-world users solving real-world problems? Or is it just code masturbation basement nerds whose idea of productivity is playing with internal guts in pursuit of some trivial abstract benchmarks?

Because, honestly, “20% faster” is an absolute joke. If I can’t make my program 200% faster just by adding a second hardware box, then I’ll want to know why. And if the answer is no more complex than “because the language isn’t very good at parallelism”, then all other arguments are completely moot.

..

Look, I’ve written slow interpreters. Implemented in Python, no less. A not-very-complex program might take 2 minutes to run. But then, 80% of that painfully long run-time is actually IO-bound operations, and even that is totally irrelevant when those 2 minutes of machine time have replaced 20 minutes of manual work.

That’s 20 minutes of paid human labor, eliminated by a really-slow custom interpreter written in pretty-slow CPython. You can easily put a dollar cost on that human time (salary, etc) and multiply it by the number of work units in a year, and you’ve calculated its real-world benefit.

Let us know when you can calculate the real-world benefit of a 20% quicker proprietary Python-like interpreter that may or may not execute user programs exactly the same as CPython. Otherwise, as I say, anything less than a magnitude’s improvement isn’t even worth getting out of bed for.

Re:Pyston v2: Faster Python by coldtea on Wednesday October 28, 2020 @04:32PM (#24923793)
>Almost all arguments in favor of Python is about sunk cost. Not much about the actual language is appealing compared to modern languages.

Well, I, for one, use Python because "the actual language is appealing compared to modern languages".

Re:Pyston v2: Faster Python by hhas01 on Wednesday October 28, 2020 @04:20PM (#24923673)
Ah, sunk costs. Where the future goes to die.

And I say this as a 20-year Python user myself, ’cos while it has scratched many itches and continues to do so, I am not the least bit sentimental about it. The best compliment would be to kill it with something far better, that steals all its good parts and replaces the rest.

Re:Pyston v2: Faster Python by ehsankia on Wednesday October 28, 2020 @02:51PM (#24922640)
Well that still goes in the "ease-of-use" bucket in my opinion.

That being said, those libraries are already highly optimized and all the heavy stuff running on C anyways, so making the Python itself faster won't make that much of a difference in those workflows.

Re:Pyston v2: Faster Python by throwaway5752 on Wednesday October 28, 2020 @02:47PM (#24922604)
Aren't all of those mostly implemented in C or C++ extensions? Not to minimize speeding up the glue code, but I don't know if they will see that large of an improvement.
Re:Pyston v2: Faster Python by anakaine on Wednesday October 28, 2020 @03:09PM (#24922875)
I'm in 5he same bucket here. My other ecosystem products are built on top of python, so we make use of pandas, numpy, dask, and our vendors own modules (which have taken them 10+ years to put together with a reasonably full team).
Re:Pyston v2: Faster Python by wil421 on Wednesday October 28, 2020 @02:42PM (#24922534)
The 20% speed up looked like it was for flask and Django. In their benchmarks PyTorch did not have a speed increase.
Re:Pyston v2: Faster Python by austinpena on Wednesday October 28, 2020 @02:48PM (#24922613)
Likely because pytorch uses C++ under the hood.
Re:Pyston v2: Faster Python by irrational on Wednesday October 28, 2020 @02:37PM (#24922481)
Maybe. One of my projects at work is supporting a legacy ColdFusion website that is nearly 20 years old (well, it was started 20 years ago, but has seen updates since). We'd love to move it to something faster, but it is huge and it would literally take years to rewrite it. Other things take priority so it will probably never be rewritten. I imagine there are Python projects in a similar boat.
Re:Pyston v2: Faster Python by pastage on Wednesday October 28, 2020 @02:50PM (#24922637)
Rewriting parts of it will not take years. Most of it can probably be thrown away, replaced by standard components. (only talking from personal experience, sure we had legacy systems running for years).
Re:Pyston v2: Faster Python by irrational on Wednesday October 28, 2020 @03:03PM (#24922800)
Unfortunately that wouldn't work with this site. Between the five of us in my group we have nearly 100 years of developer experience. We've talked a lot about if there is anyway we could divest of it a little at a time or replace parts of it, but we really can't.
Re:Pyston v2: Faster Python by tgv on Wednesday October 28, 2020 @02:09PM (#24922132)
I feel you, but then again, Python applications tend to deployed anyway, so a speed boost can be welcome for some. Memory usage looks better, too.
Re:Pyston v2: Faster Python by coldtea on Wednesday October 28, 2020 @04:31PM (#24923776)
>I feel like anybody really searching for speed is using something other than Python.

Well, anybody using Python for all its over benefits, still would very much like more speed.

Re:Pyston v2: Faster Python by RandallBrown on Wednesday October 28, 2020 @02:09PM (#24922131)
Sure, but there's lots of people already using Python that would probably love some more speed.
Re:Pyston v2: Faster Python by sally1620 on Wednesday October 28, 2020 @11:21PM (#24926816)
It is not about searching for speed. It is about lowering the cost of large Python code base running in production.
Re:Pyston v2: Faster Python by nerdtime on Wednesday October 28, 2020 @11:59PM (#24927046)
Why not make the languages that are easy to use speedy? That way I don't have to search for one or the other.