msg402311 - (view) |
Author: Pablo Galindo Salgado (pablogsal) *  |
Date: 2021-09-21 10:41 |
Removing the usage of the C stack in Python-to-Python calls will allow future optimizations in the eval loop to take place and can yield some speed ups given that we will be removing C function calls and preambles by inlining the callee in the same eval loop as the caller.
|
msg402429 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2021-09-22 12:52 |
AFAIK Mark Shannon proposed this idea, but it was rejected.
|
msg402430 - (view) |
Author: Pablo Galindo Salgado (pablogsal) *  |
Date: 2021-09-22 13:04 |
What was rejected was https://www.python.org/dev/peps/pep-0651/ which included this idea but had a lot more stuff in it. In particular, it was rejected because it gave semantics to overflow exceptions (two exceptions were proposed), new APIs and it had lack consistent guarantees for different platforms, among other considerations.
This version is just for optimization purposes with no changes in semantics.
|
msg402485 - (view) |
Author: Christian Tismer (Christian.Tismer) *  |
Date: 2021-09-23 09:39 |
Hey guys, you know that you are about to implement the core idea of Stackless Python, right? :-D
|
msg402491 - (view) |
Author: Mark Shannon (Mark.Shannon) *  |
Date: 2021-09-23 11:05 |
I've trying to do this since about 2011 :)
|
msg402504 - (view) |
Author: Steve Dower (steve.dower) *  |
Date: 2021-09-23 15:59 |
I fully support implementing the core idea of Stackless Python :)
I spent a whole EuroPython a couple of years back discussing the idea with (apparently) everyone except Mark.
Though I wouldn't like to lose the ability to extract the Python stack by inspecting native memory alone. That is very useful for debugging, particularly when you've only got a crash dump. So provided all the code objects are only an indirection or two away from a local (or better yet, parameter) value, it should be fine.
|
msg402518 - (view) |
Author: Pablo Galindo Salgado (pablogsal) *  |
Date: 2021-09-23 18:01 |
> Though I wouldn't like to lose the ability to extract the Python stack by inspecting native memory alone.
Don't worry about it, I am personally making sure that keeps being possible. it will need some changes in the tools, but not any more that any other changes between minor versions of the interpreter
|
msg402546 - (view) |
Author: Christian Tismer (Christian.Tismer) *  |
Date: 2021-09-24 09:16 |
FYI., in Stackless Python I built a chain of frames by a double linked list. This was the replacement for the current frame/stack mix.
Debugging was still quite easy, following this frame chain.
Note that it is a rather easy step to add the capability to squirrel the whole current chain away and replace it by another one. Add some header to such a chain, and you can call it "Tasklet".
|
msg402763 - (view) |
Author: Mark Shannon (Mark.Shannon) *  |
Date: 2021-09-28 10:03 |
PR 28488 has no NEWS entry, or What's New entry.
However, adding multiple entries will be confusing, so that's best left until all calls to Python functions and method don't use the C stack.
|
msg402766 - (view) |
Author: Christian Tismer (Christian.Tismer) *  |
Date: 2021-09-28 11:11 |
FWIW, getting all function to avoid the C stack will most probably take a long time, if it happens at all. Especially functions which might call into Python multiple times must be re-designed heavily, turned into multiple pieces to be in tail position. Been there, long ago... :)
|
msg402767 - (view) |
Author: Pablo Galindo Salgado (pablogsal) *  |
Date: 2021-09-28 11:41 |
We are starting to optimize first the easy cases of CALL_FUNCTION and move slowly to add more and more calls into it. This approach has the advantage that allow us to take it in small increments.
|
msg402780 - (view) |
Author: Christian Tismer (Christian.Tismer) *  |
Date: 2021-09-28 14:57 |
Very much appreciated approach.
Too bad that things stop when people are writing extensions as usual. Or do you think we can teach them how to avoid the C stack? Anyway, good luck!
|
msg402785 - (view) |
Author: Steve Dower (steve.dower) *  |
Date: 2021-09-28 16:09 |
The goal is reduced stack depth, not reframing the entire call model around not having a C stack.
We can't even reasonably rewrite getattr() without supporting callbacks from C into Python, so further generalisation is very unlikely.
But if you inspect the native stack of most Python programs, you'll see that it's mostly taken up with calls within Python code. Compressing all of those is a significant advantage, akin to inlining the Python code at compile time, even if it doesn't see "through" native calls.
|
msg403538 - (view) |
Author: Pablo Galindo Salgado (pablogsal) *  |
Date: 2021-10-09 15:51 |
New changeset b4903afd4debbbd71dc49a2c8fefa74a3b6c6832 by Pablo Galindo Salgado in branch 'main':
bpo-45256: Remove the usage of the C stack in Python to Python calls (GH-28488)
https://github.com/python/cpython/commit/b4903afd4debbbd71dc49a2c8fefa74a3b6c6832
|
msg403543 - (view) |
Author: Pablo Galindo Salgado (pablogsal) *  |
Date: 2021-10-09 16:52 |
New changeset 543acbce5a1e23633379a853f38dc55b12f6d931 by Pablo Galindo Salgado in branch 'main':
bpo-45256: Small cleanups for the code that inlines Python-to-Python calls in ceval.c (GH-28836)
https://github.com/python/cpython/commit/543acbce5a1e23633379a853f38dc55b12f6d931
|
msg403832 - (view) |
Author: Mark Shannon (Mark.Shannon) *  |
Date: 2021-10-13 13:38 |
New changeset 3901c081143ef29624f9c1cb49cc70a70321d139 by Pablo Galindo Salgado in branch 'main':
bpo-45256: Fix cleanup of stolen locals for Python-to-Python calls (GH-28905)
https://github.com/python/cpython/commit/3901c081143ef29624f9c1cb49cc70a70321d139
|
msg404166 - (view) |
Author: Mark Shannon (Mark.Shannon) *  |
Date: 2021-10-18 08:57 |
New changeset 70945d57e775b335eb58b734d82e68484063e835 by Mark Shannon in branch 'main':
bpo-45256: Avoid C calls for most Python to Python calls. (GH-28937)
https://github.com/python/cpython/commit/70945d57e775b335eb58b734d82e68484063e835
|
msg405109 - (view) |
Author: Pablo Galindo Salgado (pablogsal) *  |
Date: 2021-10-27 16:22 |
Unfortunately, seems that https://github.com/python/cpython/pull/28937 has broken the AMD64 FreeBSD Shared 3.x buildbot:
https://buildbot.python.org/all/#/builders/483/builds/1003/steps/5/logs/stdio
The buildbot was green until we merged this
|
msg405193 - (view) |
Author: Mark Shannon (Mark.Shannon) *  |
Date: 2021-10-28 15:15 |
New changeset 7f61d9d84843e3445f62eb00c47902f0daa30a72 by Mark Shannon in branch 'main':
bpo-45256: Rationalize code around Python-to-Python calls a bit. (GH-29235)
https://github.com/python/cpython/commit/7f61d9d84843e3445f62eb00c47902f0daa30a72
|
msg406462 - (view) |
Author: Mark Shannon (Mark.Shannon) *  |
Date: 2021-11-17 09:52 |
https://bugs.python.org/issue45829 is the related issue for special methods
|
msg409753 - (view) |
Author: Mark Shannon (Mark.Shannon) *  |
Date: 2022-01-05 11:30 |
New changeset 332e6b972567debfa9d8f3f9a4a966c7ad15eec9 by Brandt Bucher in branch 'main':
bpo-45256: Don't track the exact depth of each `InterpreterFrame` (GH-30372)
https://github.com/python/cpython/commit/332e6b972567debfa9d8f3f9a4a966c7ad15eec9
|
|
Date |
User |
Action |
Args |
2022-04-11 14:59:50 | admin | set | github: 89419 |
2022-01-06 12:52:24 | Mark.Shannon | set | status: open -> closed resolution: fixed stage: patch review -> resolved |
2022-01-05 11:30:34 | Mark.Shannon | set | messages:
+ msg409753 |
2022-01-03 21:54:24 | brandtbucher | set | nosy:
+ brandtbucher pull_requests:
+ pull_request28584
|
2021-12-06 13:23:16 | vstinner | set | nosy:
- vstinner
|
2021-12-06 11:43:40 | pmpp | set | nosy:
+ pmpp
|
2021-11-17 09:52:37 | Mark.Shannon | set | messages:
+ msg406462 |
2021-10-29 16:12:56 | thesamesam | set | nosy:
+ thesamesam
|
2021-10-28 15:15:07 | Mark.Shannon | set | messages:
+ msg405193 |
2021-10-27 16:22:26 | pablogsal | set | messages:
+ msg405109 |
2021-10-27 13:27:00 | Mark.Shannon | set | pull_requests:
+ pull_request27501 |
2021-10-27 12:27:15 | Mark.Shannon | set | pull_requests:
+ pull_request27498 |
2021-10-18 08:57:28 | Mark.Shannon | set | messages:
+ msg404166 |
2021-10-13 16:48:56 | Mark.Shannon | set | pull_requests:
+ pull_request27226 |
2021-10-13 13:38:49 | Mark.Shannon | set | messages:
+ msg403832 |
2021-10-12 16:43:59 | pablogsal | set | pull_requests:
+ pull_request27196 |
2021-10-09 16:52:09 | pablogsal | set | messages:
+ msg403543 |
2021-10-09 16:07:50 | pablogsal | set | pull_requests:
+ pull_request27152 |
2021-10-09 15:51:34 | pablogsal | set | messages:
+ msg403538 |
2021-09-28 16:09:12 | steve.dower | set | messages:
+ msg402785 |
2021-09-28 14:57:25 | Christian.Tismer | set | messages:
+ msg402780 |
2021-09-28 11:41:33 | pablogsal | set | messages:
+ msg402767 |
2021-09-28 11:11:32 | Christian.Tismer | set | messages:
+ msg402766 |
2021-09-28 10:03:21 | Mark.Shannon | set | messages:
+ msg402763 |
2021-09-24 09:16:19 | Christian.Tismer | set | messages:
+ msg402546 |
2021-09-23 18:01:17 | pablogsal | set | messages:
+ msg402518 |
2021-09-23 15:59:03 | steve.dower | set | nosy:
+ steve.dower messages:
+ msg402504
|
2021-09-23 11:05:30 | Mark.Shannon | set | messages:
+ msg402491 |
2021-09-23 09:39:02 | Christian.Tismer | set | nosy:
+ Christian.Tismer messages:
+ msg402485
|
2021-09-22 15:57:55 | vstinner | set | title: Remove the usage of the cstack in Python to Python calls -> Remove the usage of the C stack in Python to Python calls |
2021-09-22 14:07:09 | vstinner | set | nosy:
+ vstinner
|
2021-09-22 13:04:35 | pablogsal | set | messages:
+ msg402430 |
2021-09-22 12:52:08 | serhiy.storchaka | set | nosy:
+ serhiy.storchaka, gvanrossum messages:
+ msg402429
|
2021-09-22 12:24:21 | corona10 | set | nosy:
+ corona10
|
2021-09-21 14:47:35 | kj | set | nosy:
+ kj
|
2021-09-21 10:42:59 | pablogsal | set | keywords:
+ patch stage: patch review pull_requests:
+ pull_request26884 |
2021-09-21 10:41:59 | pablogsal | create | |