◐ Shell
clean mode source ↗

GH-104584: Optimizer API by markshannon · Pull Request #105100 · python/cpython

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit confused about how an optimizer would actually make use of these four bits. The optimizer only gets invoked when its threshold is met, and when the optimizer is invoked, it is required to return an executor (returning NULL signals an exception). The executor will generally be per-hotspot, and can have as much custom state in it as the optimizer wants.

I guess the use case might be that sometimes an optimizer will choose to set a shared no-op executor for some reason (so if it's shared, it can't store per-hotspot state in it), but still want to store some per-hotspot state?