Changes between Initial Version and Version 1 of Ticket #13394, comment 54


Ignore:
Timestamp:
10/31/13 06:02:02 (5 years ago)
Author:
nbruin
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #13394, comment 54

    initial v1  
    11I have attached a !WeakValueDictionary based on your prototype, but directly implemented on `dict`. It's a drop-in replacement, so you can use it right away (and you can probably more easily test its performance). In my preliminary checks it seems (much) faster than `weakref.WeakValueDictionary` in all situations (not surprising since it's cythonized) and I think also always a bit faster than your prototype (it should be with one level of indirection less)
    22
    3 I have not made explicit modifications "safe" for dictionary iteration, although in most cases they should be fairly safe: python's dict only reshapes on ''adding'' entries, so enumerating entries shouldn't lead to huge problems (except for non-determinism).
     3I have not made explicit modifications "safe" for dictionary iteration, although in most cases they should be fairly safe: python's dict only reshapes on ''adding'' entries, so mixing enumerating entries and removing them shouldn't lead to huge problems (except for non-determinism), but I think doing so is always a bug waiting to happen.
    44
    55Notes I found when adapting your code: