Does ETS set guarantee that internal order of tuples is the same as the order by which they were inserted? For instance: I keep a log by inserting a tuple every second, timestamp is the key. In this example, does set guarantee that tuples are sorted by the key?
I understand that ordered_set would do what I wish, but it has a insert overhead. So if set keeps the insert order, then using set would be much more efficient in my example. So, does it? :-)
Thanks in advance, Nikola
No, for table type set there are no guarantees at all of what order the keys are sorted. They are hashed and then the hash value is used to put the elements in a table. The table is occasionally resized and resorted as well so the order will change. So no, you were just lucky.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With