I need to build a FIFO and I need it to be fast. I want to log values at 10 Hz into a file and it needs to be about 30 points over the past 5 minutes.

So the process looks like:

1) append record containing 30 points to fifo
2) remove first record from fifo
3) dump to file

And I'm doing this 10 times a second and I want to keep the last 5 minutes worth of data. What is the fastest way to do this?