Live data from Hacker News

Python 3.11 vs 3.10 performance

github.com

411–420 of 460 posts

Re: Python 3.11 vs 3.10 performance

#411

Earlier quoted context omitted.

> Inlined python functions are called in pure python without needing to jump through C Given that Python is interpreted, it's quite unclear what this could mean. Also, what does it mean to "call" an inlined function?? Isn't the point of inline functions that they don't get called at all?

> Given that Python is interpreted, it's quite unclear what this could mean. Python is compiled. CPython runs bytecode. (If Python is interpreted, then so is Java without the JIT).

I don't think that calling non-JITed Java 'interpreted' is in any way controversial.

Re: Python 3.11 vs 3.10 performance

#412

This use of "faster" in the text; I think they mean "as fast". "1x faster" to me says twice the speed of the original, but I believe they use it to mean "the same speed".

That's not actually a bad observation even though you were downvoted. I think in the end it's technically ambiguous but most people would be able to see what is meant especially given the previous performance is present (i.e. for benchmark "deltablue" we have columns "12.4 ms" and "6.35 ms (1.96x faster)".

But you're right, I think "1.96x as fast" sounds more correct.

edit: but now that I think about it "X as fast" or "X faster" in terms of a duration will always sound a bit weird

Re: Python 3.11 vs 3.10 performance

#413

Earlier quoted context omitted.

Hold my beer! https://i.redd.it/8waggyjyyle51.png

Hold mine :D https://github.com/anchpop/genomics_viz/blob/master/genomics... That's one expression because it used to be part of a giant comprehension, but I moved it into a function for a bit more readability. I'm considering moving it back just for kicks though. My philosophy is: if you're only barely smart enough to code it, you aren't smart enough to debug it. Therefore, you should code at your limit, to force yo…

https://www.reddit.com/r/ProgrammerHumor/comments/uosex4/no_...

Re: Python 3.11 vs 3.10 performance

#414
post #305

Earlier quoted context omitted.

Because Guido van Rossum just isn't very good with performance, and when others tried to contribute improvements, he started heckling their talk because he thought they were “condescending”: https://lwn.net/Articles/754163/ And by this time, we've come to the point where the Python extension API is as good as set in stone. Note that all of the given benchmarks are microbenchmarks; the gains in 3.11 are _much_ less pr…

Yeah breaking compatibility kills a language. He did the right thing.

yet breaking compatibility in the 2->3 transition so that we can use print in lambdas was perfectly fine.

Re: Python 3.11 vs 3.10 performance

#415

Earlier quoted context omitted.

Cool, they should start now. As a python dev, pythons multiprocess/multithreading story is one the largest pain points in the language. Single threaded performance is not that useful while processors have been growing sideways for 10 years. I often look at elixir with jealousy.

Or maybe keep things the way they are.If you really need performance python is not the language you should be looking for. Instead of breaking decades of code, maybe use a language like Go or Rust for performance instead.

Concurrency is not solely required for performance. I'm designing a small tool (a file ingester/processor) for myself, which gonna need several, really concurrent threads. I love Python, but I can't use that, so I'm learning Go.

Re: Python 3.11 vs 3.10 performance

#416

Earlier quoted context omitted.

> I've asked merely to clarify whether your issue is with Python's asyncio (e.g. Python got it wrong) or with the tradeoffs inherent in async io APIs in general (regardless of Python) Both, but the latter part is contextual. > I, for one, am fine with async APIs in JS Correct me if you think I'm wrong, but JS in its native environment (the browser) never had access to the OS thread and process scheduler, so the conce…

> 1. Python has never had that constraint Which is neither here, nor there. Python had another big constraint, the GIL. So threads there couldn't go so far as async would. But even environments with threads (C#, Rust) also got big into async in the same style. > 2. Python's asyncio in particular is a shitty hammer that only works on special asyncio-branded nails Well, that's also the case with C#, JS, and others with…

What has GIL to do with the thread model vs asyncio? asyncio is also single threaded, so cooperative (and even preemptive) green threads would have been a fully backward compatible option.

JS never had an option as, as far as I understand, callback based async was already the norm, so async functions were an improvement over what came before. C# wants to be an high performance language, so using async to avoid allocating a full call stack per task is understandable. In python the bottleneck would be elsewhere, so scaling would be in no way limited by the amount of stack space you can allocate, so adding async is really hard to justify.

Re: Python 3.11 vs 3.10 performance

#417
post #372

Earlier quoted context omitted.

Removing GIL also breaks existing native packages, and would require wholesale migration across the entire ecosystem, on a scale not dissimilar to what we've seen with Python 3.

> on a scale not dissimilar to what we've seen with Python 3. If only people had asked for it before the Python 3 migration so it could have been done with all the other breaking and performance harming changes. But no, people only started to ask for it literally yesterday so it just could not ever be done, my bad. /sarcasm If anything the whole Python 3 migration makes any argument against the removal of the GIL app…

We didn't get any performance improvements, but at least now we can call print from lambda functions, that's was certainly worth the massive breakage.

Re: Python 3.11 vs 3.10 performance

#418

Earlier quoted context omitted.

Global Interpreter Lock (GIL) is also an issue affecting Python execution speed: https://en.wikipedia.org/wiki/Global_interpreter_lock

Not really, no. It prevents you from taking advantage of multiple cores. Doesn't really impact straight-line execution speed. A data structures course is primarily not going to be concerned with multithreading.

>> It prevents you from taking advantage of multiple cores. Doesn't really impact straight-line execution speed.

Most computers running Python today will have multiple cores. If your program can only use a fraction of its available computing power, it affects the program's execution speed. Python is too widely used in compute-intensive applications (e.g. machine learning) for GIL-related issues to be ignored in the long term.

Ideally, Python should have automatic load scaling and thread-safe data structures in the standard library to take advantage of all available CPU cores.

Java has had concurrent data structures in its standard library for years and is adding support for "easy" multi-threaded execution with Project Loom.

Python needs to add its own Pythonic versions of thread-safe data structures and compute load scaling to take advantage of the multi-core CPUs that it runs on.

>> A data structures course is primarily not going to be concerned with multithreading.

A graduate-level data structures course might include concurrent and parallel data structures.

Re: Python 3.11 vs 3.10 performance

#419

Earlier quoted context omitted.

This is the first time I ever heard someone complain about Python's error messages in the 10+ years I've been using it. Even people who just learned it, pick up reading tracebacks after about a day of practice. The only problem I ever see is if a library swallows too much, and gives a generic error, but that's not something the language can fix. I really hope they don't change things too much.

I only rarely delve into the python world, but as a .net developer I always found it odd and confusing that the error message comes after the stack trace in python. I don’t see people complaining about it, so maybe it’s just a matter of habit?

On the CLI, you'll see the error just above the prompt and then the stack trace above that. It makes sense since the user is always reading up the terminal in reverse order.

Re: Python 3.11 vs 3.10 performance

#420
post #29

Earlier quoted context omitted.

> Low-hanging fruits attract people who can't reach higher than that. Do we have completely different definitions of low-hanging fruit? Python not "requiring" speed is a fair enough point if you want to argue against large complex performance-focused initiatives that consume too much of the team's time, but the whole point of calling something "low-hanging fruit" is precisely that they're easy wins — get the performa…

> is precisely that they're easy wins — get the performance without a large effort commitment. Oh, that's not how I interpret low-hanging fruits. From my perspective a "low-hanging fruit" is like cheap pops in wrestling. Things you say of which you know that it will cause a positive reaction, like saying the name of the town you're in. As far as I know, the low-hanging fruit isn't named like that because of the fruit…

https://en.wiktionary.org/wiki/low-hanging_fruit

Easily obtained gains; what can be obtained by readily available means

https://www.merriam-webster.com/dictionary/low-hanging%20fru...

the obvious or easy things that can be most readily done or dealt with in achieving success or making progress toward an objective

"Maria and Victor have about three months' living expenses set aside. That's actually pretty good …. But I urged them to do better …. Looking at their monthly expenses, we found a few pieces of low-hanging fruit: Two hundred dollars a month on clothes? I don't think so. Another $155 for hair and manicures? Denied."

"As the writers and producers sat down in spring 2007 to draw the outlines of Season 7, they knew, Mr. Gordon said, that most of the low-hanging fruit in the action genre had already been picked."

"When business types talk about picking low-hanging fruit, they don't mean, heaven forbid, doing actual physical labor. They mean finding easy solutions."

https://dictionary.cambridge.org/dictionary/english/low-hang...

something that is easy to obtain, achieve, or take advantage of

"The easy changes have all been made. All the low-hanging fruit has been picked."

"When cutting costs, many companies start with the low-hanging fruit: their ad budgets."

"For the beauty-care industry, the teen demographic is a new category for them - low-hanging fruit."

"I'm a great believer in picking low-hanging fruit. Start with what's easy, and go higher later."

"This legislation is some of the low-hanging fruit - the issues that we can agree upon across parties and regions."

Post reply on HN