in reply to Re^3: RFC - Tie::Hash::Ranked
in thread RFC - Tie::Hash::Ranked
I had considered making changes "smart" but it was not clear to me that it would be more efficient. It all depends on how it is used. If the hash is asked for many times with only a few number of changes in between it makes sense to use "smart" inserts. If on the other hand the hash is asked for only intermittently with potentially many changes it makes sense to use my current approach.
I guess if I make any modifications, which I am currently not inclined to do - I would provide the option of selecting which "mode" to use since the efficiency of either approach depends on usage.
Cheers - L~R
Update: (in response to your update):
they don't actually help asymptotically, unless you perform O(n log n) insert/delete/fetch operations in between every call to keys.
Not exactly. Unless there are changes and those changes effect the order and those changes accumulate to O(n log n).
|
|---|