On 03.02.2016 22:22, Yury Selivanov wrote: > One way of tackling this is to give each optimized opcode > a counter for hit/misses. When we have a "hit" we increment > that counter, when it's a miss, we decrement it. Within a given range, I suppose. Like: c = min(c+1, 100) > > I kind of have something like that right now: > https://github.com/1st1/cpython/blob/opcache5/Python/ceval.c#L3035 > > But I only decrement that counter -- the idea is that LOAD_ATTR > is allowed to "miss" only 20 times before getting deoptimized. > > I'll experiment with inc/dec on hit/miss and see how that affects > the performance. > > An ideal way would be to calculate a hit/miss ratio over time > for each cached opcode, but that would be an expensive > calculation.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4