I wish there was something like llvm for scripting languages. Imagine if python, php, javascript, dart or ruby would not interpret the code themself, but compile to an interpretable common language, where you could just plug in the fastest interpreter there is for the job.
https://github.com/mypyc/mypyc > Mypyc compiles Python modules to C extensions. It uses standard Python type hints to generate fast code. Mypyc uses mypy to perform type checking and type inference.
Python 3.11 vs 3.10 performance
211–220 of 460 posts
Re: Python 3.11 vs 3.10 performance
#212Earlier quoted context omitted.
"Debugging is twice as hard as writing the code in the first place. Therfore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." - Rajanand Although, personally, I enjoy python list comprehensions.
I believe that quote about debugging being twice as hard as coding is by Brian Kernighan. https://en.m.wikiquote.org/wiki/Brian_Kernighan
Re: Python 3.11 vs 3.10 performance
#213Earlier quoted context omitted.
Those people were not being paid to speed up CPython, though, but mostly-source-compatible (but not at all native extension compatible) alternative interpreters.
That's because the core team wasn't friendly to them making changes in CPython. Not because they deliberately only wanted to build an alternative interpreter.
Current changes don't really break it.
Re: Python 3.11 vs 3.10 performance
#214Earlier quoted context omitted.
>Python being interpreted is the main reason why it’s slow Common Lisp and Java begs to disagree.
Jvm at least is jitted, not interpreted. Dunno anything about common lisp.
Re: Python 3.11 vs 3.10 performance
#215Earlier quoted context omitted.
O, I agree. As I said, when python and its uses scaled, it became quite necessary to make it fast. I like that it will be fast as well and I am not happy that it is slow at the moment. My point is that there are reasons why it was not optimized in the beginning and why this process of optimizations has started now.
Back when Python was started there was really C or C++ for optimized programs and scripting languages like Python and Perl. But since Python had the ability for C Extensions it allowed it to bypass those problems. Since Python was easy to learn both web developers and scientists to learn. Then financial organizations started to get interested and that’s really how Python cemented itself. What exactly do you do with P…
I still use Python for cases when dev time is more important than execution time (which is rarer now that I'm working adjacent to "big data") or when I'm doing things like writing python to close gaps in the various arrays of web apps provided for navigating the corporate work flow, and if I went as fast as a 64 core box let me, we'd have some outages in corp github or artifactory or the like, so I just do it one slow thing at a time on 1 core and wait for the results. Maybe multiprocessing with 10 process worker pool once I'm somewhat confident in the back end system I am talking to.
(edit: removed my normal email signoff)
Re: Python 3.11 vs 3.10 performance
#216Earlier quoted context omitted.
Yes, you can spend a large amount of time making things faster. But note that Go's GC is fast, even though it is simple. It's not the fastest, but it is acceptably fast.
Funny you should pick that example in a sub thread that you started with an assertion that code should be fast from by default. Go’s GC was intentionally slow at first. They wanted to get it right THEN make it fast. No offense but you’re not making a strong case. You’re sounding like an inexperienced coder that hasn’t yet learned that premature optimization is bad.
Re: Python 3.11 vs 3.10 performance
#217Earlier quoted context omitted.
When you only have so many hours to go around, you concentrate on the main goals.
My point is that you can write fast code just as easily as you can write slow code. So engineers should write fast code when possible. Obviously you can spend a lot of time making things faster, but that doesn't mean you can't be fast by default.
Re: Python 3.11 vs 3.10 performance
#218Earlier quoted context omitted.
> Things should be fast by default. In over 90% of my work in the SW industry, being fast(er) was of no benefit to anyone. So no, it should not be fast by default.
Ha! Good luck convincing end-users that that's true.
Re: Python 3.11 vs 3.10 performance
#219There was always a denial of removing the Global Interpreter Lock because it would decrease single threaded Python speed for which most people din’t care. So I remember a guy recently came up with a patch that both removed GIL and also to make it easier for the core team to accept it he added also an equivalent number of optimizations. I hope this release was is not we got the optimizations but ignored the GIL part.…
Re: Python 3.11 vs 3.10 performance
#220Earlier quoted context omitted.
Concurrency in Python is a weird topic, since multiprocessing is the only "real" concurrency. Threading is "implicit" context switching all in the same process/thread, asyncio is "explicit" context switching. On top of that, you also have the complication of the GIL. If threads don't release the GIL, then you can't effectively switch contexts.
Threading IS concurrency. When you say "real" concurrency, you actually mean parallelism.