I have been thinking of this construct, basically a reference to a sequence.
Is this:
RefSeq = ref object
list : seq[(int,Value)]
the same as this?
RefSeq = ref seq[(int,Value)]
I mean... performance-wise?
I think it is exactly the same.
Objects are pure by default, as long as no inheritance is involved, so there is no hidden object header in this case.
Both are the same.
I've said it in the other thread, if you want the best performance for sequences with reference semantics you should use shallow:
type
RefSeq {.shallow.} = object
list: seq[(int,Value)]
In both your example you have 2 pointer indirections while with shallow you only have one.