Mark Shannon

Results 183 comments of Mark Shannon

I'm not familiar with this code, so I might be mistaken, but... Needing a flag to determine if something is in a freelist seems risky. What if it is both...

> Mind if I take a look at this? Not at all

Once, a long time ago, the initial counter version was part of the on-disk format, so we couldn't use bit fields. Now it is set at runtime, so it might...

Unifying the counters seems reasonable. They all do much the same thing. I'd like to keep the thresholds (at least for now) for two reasons: * It provides a simple...

We can get rid of the thresholds, if it makes things significantly simpler. We can support turning off tier 2 by changing `if ((++counter) >= interp->threshold)` to `if ((counter -=...

Actually, there is no need for `interp->tier2`. `if ((--counter) == 0)` is faster, and exponential backoff means we won't be calling the optimizer function much.

Although objectively [the PR](https://github.com/python/cpython/pull/117144) makes things worse (it is larger and perhaps slower), I still think factoring out the counter is a good idea. I think that the various optimizer...

Strangely slow https://github.com/faster-cpython/benchmarking/tree/main/results/bm-20240328-3.13.0a5%2B-174fc24-JIT I may have messed something up. Maybe worth running the stats on it to see what's happening

Here are the [performance numbers](https://github.com/faster-cpython/benchmarking-public/tree/main/results/bm-20241004-3.14.0a0-adb59ef-NOGIL) Relative to the free-threading main, it is 1% faster using 2% more memory.

I've tried a couple of toy benchmarks with 1000 threads, just to check for pathological cases. Performance is no worse, nor any better than main. Release builds, but no `--lto`...