3 ms·
I wonder if they could now add a way for the interpreter to automatically find instances where it could run your code in parallel? You’d think certain patterns
by bilsbie 2y ago
I wonder if they could now add a way for the interpreter to automatically find instances where it could run your code in parallel?
You’d think certain patterns could be probably safe and the interpreter could take the initiative.
Is there a term for this concept?
- bmitc 2y agoNo way that's possible or even desirable with Python's OOP and mutable nature and scoping structure.
- jerf 2y agoAutomatic parallelization, as someone else linked to. It is another one of those things that many programmers ask "Why hasn't this been tried?" and the answer is, it has, many times over. It just failed so hard and so fast you've never heard of the results. Toy problems speed up by less than you'd hope and real code gets basically nothing. Your intuition says your code is full of parallelization opportunities; your intuition turns out to be wrong. A subset of the general problem that even very experienced developers still never get great at knowing how code will perform without simply runninga profiler. It has failed hard and fast in languages much friendlier to the process than Python. Proving something is truly parallel-safe in Fortran is hard enough. Proving it in Python is effectively impossible, you just don't know when something is going to dynamically dynamic the dynamics on you.
- biorach 2y ago> you just don't know when something is going to dynamically dynamic the dynamics on you. I'm going to use that!
- buildbot 2y agoI’ll take a different tact than previous answers and say we already do this - a modern superscalar CPU is essentially an engine for turning sequential code into 6-8 (or more!) simultaneous operations that are dispatched all at once. Downstream, some 4-8 (or more!) ops are retired at once, their operations complete. This is all in a single core.