Message387190
> +1 on exposing f,__builtins__.
This change is related to bpo-43228 "Regression in function builtins": cloudpickle is broken by this issue (new PyFunctionObject.func_builtins member).
> Of course, the thing I'd really want is a way to state that all references to builtins are meant to have the exact semantics of those builtins, so the compiler can translate e.g. len(x) into a new opcode that just calls PyObject_Size(). (I can dream, can't I?)
I tried to implement such optimization in my old https://faster-cpython.readthedocs.io/fat_python.html project. I implemented guards to de-optimize the code if a builtin is overriden.
> I suppose enough checking of dict version tags can get us there, or at least close enough.
The dict version comes from my FAT Python project: PEP 509. It is used to optimize method calls. See also PEP 510 and PEP 511 ;-) |
|
Date |
User |
Action |
Args |
2021-02-17 22:00:40 | vstinner | set | recipients:
+ vstinner, gvanrossum, brett.cannon, rhettinger, petr.viktorin, Mark.Shannon, serhiy.storchaka, yselivanov |
2021-02-17 22:00:40 | vstinner | set | messageid: <1613599240.55.0.549763490584.issue42990@roundup.psfhosted.org> |
2021-02-17 22:00:40 | vstinner | link | issue42990 messages |
2021-02-17 22:00:40 | vstinner | create | |
|