do one big resize at dict creation#21881
Conversation
|
Could you provide benchmark? I don't think this optimization is worth enough, because dict_new uses dummy key object instead of creating new small key object, and dict_merge does "one big resize". |
As I wrote in the comment, there's no optimization for now. This is preliminary for other optimizations (briefly, since the resize is done in dict_new and not in dict_merge, we can create an optimized version of dict_merge that skips a lot of checks). I'm doing this because it's really difficult to merge the code I wrote for frozendict, since I used a CPython code older of many months. About keys object, we can simply change |
|
Then I can not accept this PR. |
Preliminary commit for some speedup to dict creation