Repository navigation
Commit f11db7f
committed
cext: remove
As mentionned in #10029, since Python 3.6 `_PyDict_NewPresized()`
allocates enough space and overallocating by `1 + x / 2*3` is not needed
anymore¹.
Using the private `_PyDict_NewPresized` may not be as relevant² as it was when
its use was introduced a long time ago, but finding out is for another time.
[1] https://github.com/python/cpython/blob/8d999cbf4adea053be6dbb612b9844635c4dfb8e/Objects/dictobject.c#L1378
[2] python/cpython#139772 (comment)
--HG--
extra : topic : dict-presizing_dict_new_presized util1 parent e183aeb commit f11db7f
4 files changed
Lines changed: 3 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
245 | | - | |
| 245 | + | |
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1241 | 1241 | | |
1242 | 1242 | | |
1243 | 1243 | | |
1244 | | - | |
| 1244 | + | |
1245 | 1245 | | |
1246 | 1246 | | |
1247 | 1247 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | 56 | | |
69 | 57 | | |
70 | 58 | | |
| |||
0 commit comments