aklepatc ([personal profile] aklepatc) wrote 2024-05-08 10:13 pm (UTC)

A bit off topic...

The way you doing it in your last example is the naive way people implement FIFO queue (in both Go and Python). It works but is suboptimal b/c the memory for the popped elements is not reclaimed until reallocation.

A better way to do FIFO is a ring buffer like structure.


Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting