Are you aware of causes that prevented writing the code in this way? This will break OrderedDict. Issue31954 is an attempt to solve this problem (and it supersedes this issue).
Ah, I didn't notice that this affects only dicts with shared keys! Well, this is not related to the issue with OrderedDict which can't have shared keys. Still we need evidences of the performance benefit. The PR adds >40 lines of code and the benefit should be large enough to compensate the maintaining complexity and possible performance regressions in other parts of the code.
A little performance optimization, but I think the key is not in performance optimization. The semantics of the dictresize function are not uniform, and it is inconvenient for others to read. The dictresize function should be split to make it just resize. What do you think?
> A little performance optimization, but I think the key is not in performance optimization. > The semantics of the dictresize function are not uniform, and it is inconvenient for others to read. The dictresize function should be split to make it just resize. What do you think? I can't understand. What dictresize does now other than resize? Could you show how dictresize can be simplified when clear_dummy_keys() is added? Anyway, current my opinion is -1 on this. We can add similar function when fixing Issue31954.