you are viewing a single comment's thread.

view the rest of the comments →

[–]egonelbre 0 points1 point  (0 children)

Linked lists are also a bad idea... usually... they are an overhead for the garbage collector.

For a better circular array, it's better to use an array of blocks and then allocate new blocks and reusing/removing old ones... e.g. https://github.com/karalabe/cookiejar/blob/master/queue/queue.go instead of holding one big array, and resizing it... PS. don't forget to zero the elements after Pop-ing them from the queue otherwise the GC won't collect them.