| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
Looks good in general. Probably needs a test with buildbots though.
Sorry, something went wrong.
There was a problem hiding this comment.
Cool! Just a small flurry of questions, comments, and nits:
Sorry, something went wrong.
| here[1].cache += (1 << OPTIMIZER_BITS_IN_COUNTER); | ||
| if (here[1].cache > tstate->interp->optimizer_backedge_threshold) { | ||
| OBJECT_STAT_INC(optimization_attempts); | ||
| frame = _PyOptimizer_BackEdge(frame, here, next_instr, stack_pointer); | ||
| if (frame == NULL) { | ||
| frame = cframe.current_frame; | ||
| goto error; | ||
| } | ||
| here[1].cache &= ((1 << OPTIMIZER_BITS_IN_COUNTER) -1); |
There was a problem hiding this comment.
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?
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Only supports back edges. Adding hooks for resumption points (the RESUME instruction) is for a later PR.
Performance for an earlier version was mostly noise.
In theory we could turn off the check by using adaptive bytecode, but as we will want an always-on optimizer for tier 2, there seems little advantage to doing so.