Neil Schemenauer

Results 49 comments of Neil Schemenauer

Hi [bjorn-martinsson](https://github.com/bjorn-martinsson), I appreciate the interest in improving the functions in `_pylong.py` but polishing the functions is not the primary focus of this PR. Perhaps we should create another issue...

Some quick timing scripts. [time_divmod_fast.py.txt](https://github.com/python/cpython/files/9532190/time_divmod_fast.py.txt) [time_long_to_dec.py.txt](https://github.com/python/cpython/files/9532191/time_long_to_dec.py.txt) Results on my machine: ``` time_divmod_fast.py bits old time new time faster correct ------------------------------------------------------------------------------ 54 0.000 0.000 0.18 True 107 0.000 0.000 0.17 True...

> Neil, I think the one _basic_ thing this is missing is an asymptotically faster str->int function. Ah, okay. I extracted bjorn-martinsson's code from GH-90716. A little timing script is...

I've made some more updates, getting close to merge quality now. I would like some more unit tests yet and a good code review. My knowledge of the C-API is...

> I think it is important to be consistent with the style. Okay. To my eye, the recursive version reads easier and seems to perform just as well. I made...

I feel this is ready for review now. Removing Mark as a requested reviewer since he mentioned he might not have time to do it, at least anytime soon. I...

> I don't know about `ContextVar`s, and a quick skim of the docs left me more confused about why they exist than before I looked ☹️. They seem quite similar...

> I have one that seems faster than this module's `str_to_int` starting around 10^7 digits. At 10^8 digits it's about three times faster (on Python 3.8.12). Where's a good place...

Benchmark script extracted from bm_pidigits.py, can be run as stand-alone script. [bench_pidigits.py.txt](https://github.com/python/cpython/files/9592531/bench_pidigits.py.txt)

Another benchmark, try to determine good cutoff to switch to `int_divmod`. I'm using `(size_w > 300 && (size_v - size_w) > 300)` now which seems better. [bench_divmod.py.txt](https://github.com/python/cpython/files/9592709/bench_divmod.py.txt)