Hi everyone :) Let's say I have a very "huge" object
type
Test = object
id1, id2, id3, id4, id5, id6, id7, id8, id9, id10, id11, id12, id13,
id14,
id15, id16: uint32
Run
I make a seq of Tests
var buff = newSeq[Test](10000)
Run
Then I delete some elements from seq
for i in 2521..3201:
buff.delete(i)
Run
How I see it works:
* Test is an object without reference ( I treat it as a struct )
* By removing something from the seq it needs to be reordered. ( shift
elements )
* If it's a referenced object you shift a pointer, if it's an object you need
to copy all object data (?)
* It should be much slower than copying reference pointers (?)
But after making some profiling I got the results like : **** Time elapsed obj
removing for 0.06516200304031372 ***** **** Time elapsed ref obj removing for
0.09633999317884445 *****
I look from C# background where I have classes and structs and I understand
that structs are copied when you use a list (analog of seq?) and the bigger the
struct is the slower it gets to copy it
What I'm missing in Nim? :) Thanks in advance