Open evandrocoan opened 7 years ago
Issue #65 addressed a more general ordering of nodes by ANY attribute. SortedDict may replace the inner node dict, but it may introduce more performance concerns (see SO http://stackoverflow.com/questions/8176513/ordereddict-performance-compared-to-deque).
I see that Ordered dict is implemented in Python (slower), while the current structure is written right on C (faster). So could we create a new type of node called OrderedNode
, based on OrderedDict
, and use these nodes instead of the current nodes, if it is wanted ordered nodes. If somehow the performance for this new Node
type would be bad, an alternative could be looked into, improving the new node type OrderedNode
.
Note that regular python dictionaries started preserving insertion order as an implementation detail in cpython 3.6, and from 3.7 it's now guaranteed by Guido's decree: 'Make it so. "Dict keeps insertion order" is the ruling.' https://mail.python.org/pipermail/python-dev/2017-December/151283.html
Can it use SortedDict from the SortedCollection for children's order?
Use SortedDict from the SortedCollection.
Related to: