Message309897
What I've decided for now is to keep the freeslot reuse logic but in a simpler form. Currently there are two optimizations for rare cases. The first is reusing a dummy entry -- we'll keep that. And the second is detecting multiple dummies in a lookup chain and prefering the first in the chain -- I'm going to get rid of this I haven't found any plausible case where it demonstrates value in excess of its cost.
For it to trigger, the set has to have had a growth phase, then a number of subsequent deletions, and then later additions that have multiple collisions with dummy entries, all without any intervening resizes. Modern sets have a lower fill factor, making this situation even less likely. Also, modern sets use a series of linear probes making collisions much cheaper. The benefit is so small and so rare, it possible that the cost of the inner-loop test now exceeds its potential benefit. Given that the optimization is of questionable worth, I choose to remove it, preferring the simpler inner-loop code. |
|
Date |
User |
Action |
Args |
2018-01-13 20:14:43 | rhettinger | set | recipients:
+ rhettinger, tim.peters, vstinner, methane, serhiy.storchaka |
2018-01-13 20:14:43 | rhettinger | set | messageid: <1515874483.25.0.467229070634.issue29476@psf.upfronthosting.co.za> |
2018-01-13 20:14:43 | rhettinger | link | issue29476 messages |
2018-01-13 20:14:42 | rhettinger | create | |
|