Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This version is slightly slower than the version at https://github.com/kmsquire/OrderedCollections.jl and discussed in #2548, but thanks to @JeffBezanson pointing out some flaws in my early attempts, it's cleaner and not much slower, and most importantly, it doesn't depend on the internal implementation of
Dict
.Compared with
Dict
, it has ~40% insertion and ~50% deletion overhead.The version at https://github.com/kmsquire/OrderedCollections.jl has a similar insertion overhead, and a ~10% deletion overhead.
I can submit the version at https://github.com/kmsquire/OrderedCollections.jl instead (which is a simple modification of(Done.)Dict
injulia/base
), or make that one available via a package. Other suggested updates or improvements are welcome.EDIT:
I would appreciate any feedback on this version vs. the one based on AbstractHashDict in #2548. My own take is that this one is a bit cleaner, and that one is a bit faster, but somewhat invasive. @JeffBezanson expressed some concern about the other version earlier, but still seemed open to exploring it.
It may be the case that a doubly-linked list version of
OrderedDict
is better, so someone should feel free to contribute that as an alternative (or addition).