SIGN IN SIGN UP
python / cpython UNCLAIMED

The Python programming language

72153 0 0 Python

bpo-43950: optimize column table assembling with pre-sizing object (GH-26997)

The new resizing system works like this;
```
$ cat t.py
a + a + a + b + c + a + a + a + b + c + a + a + a + b + c + a + a + a + b + c
[repeated 99 more times]
$ ./python t.py
RESIZE: prev len = 32, new len = 66
FINAL SIZE: 56
-----------------------------------------------------
RESIZE: prev len = 32, new len = 66
RESIZE: prev len = 66, new len = 134
RESIZE: prev len = 134, new len = 270
RESIZE: prev len = 270, new len = 542
RESIZE: prev len = 542, new len = 1086
RESIZE: prev len = 1086, new len = 2174
RESIZE: prev len = 2174, new len = 4350
RESIZE: prev len = 4350, new len = 8702
FINAL SIZE: 8004
```

So now we do considerably lower number of `_PyBytes_Resize` calls.

Automerge-Triggered-By: GH:isidentical
B
Batuhan Taskaya committed
ec8759b060eff83ff466f42c5a96d83a685016ce
Parent: 2560c61
Committed by GitHub <noreply@github.com> on 7/2/2021, 7:03:58 PM