06.11.13 07:41, Nick Coghlan написав(ла): > If the benchmark suite indicates there's no measurable speed penalty > then such a patch may be worth reconsidering. I don't see any significant speed difference even in artificial presumably worst case (a lot of items assignment in tight loop). If you have tests which demonstrate a difference, please show them. > I'd be astonished if that > was actually the case, though - the lowest impact approach I can think > of is to check for live iterators when setting a dict entry, and that > still has non-trivial size and speed implications. Actually we should guard not against changing dict during iteration, but against iterating modifying dict (and only such modifications which change dict's keys). For this we need only keys modification counter in a dict and it's copy in an iterator (this doesn't increase memory requirements however). I suppose Java use same technique in HashMap.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4