GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Pluggable optimizer API · Issue #104584 · python/cpython Closed Labels 3.13only security fixesonly security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usagePerformance or resource usage DescriptionWe need an API for optimizers to be plugged in to CPython. The proposed model is that of client server, where the VM is the client and the optimizer is the server. The API: type struct { OBJECT_HEADER; _PyInterpreterFrame *(*execute)(PyExecutorObject *self, _PyInterpreterFrame *frame, PyObject **stack_pointer); /* Data needed by the executor goes here, but is opaque to the VM */ } PyExecutorObject; /* This would be nicer as an enum, but C doesn't define the size of enums */ #define PY_OPTIMIZE_FUNCTION_ENTRY 1 #define PY_OPTIMIZE_RESUME_AFTER_YIELD 2 #define PY_OPTIMIZE_BACK_EDGE 4 typedef uint32_t PyOptimizerCapabilities; type struct { OBJECT_HEADER; PyExecutorObject *(*compile)(PyOptimizerObject* self, PyCodeObject *code, int offset); PyOptimizerCapabilities capabilities; float optimization_cost; float run_cost; /* Data needed by the compiler goes here, but is opaque to the VM */ } PyOptimizerObject; void _Py_Executor_Replace(PyCodeObject *code, int offset, PyExecutorObject *executor); int _Py_Optimizer_Register(PyOptimizerObject* optimizer); The semantics of a Full discussion here: faster-cpython/ideas#380 This is not a replacement for PEP 523. That will need a PEP. We should get this working first, before we consider replacing PEP 523. Linked PRs
Reacted by Hai Shi Reacted by Donghee Na, sunmy2019, Steve Dower and Erlend E. Aasland Activity
MetadataMetadataAssigneesLabels3.13only security fixesonly security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usagePerformance or resource usage ProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |