I get all kinds of data, which gets updated every second. I need to write a function that gives me the last 30 values (of the last 30 seconds) of a certain attribute. What would be the most memory-efficient way to save the last 30 values of something? Everything older than 30 seconds can be discarded. I have to do this action 96k times/second.
Asked
Active
Viewed 43 times
0
-
1Do you need to retain the order of those 30? – Boris Strandjev Jan 30 '20 at 11:47
-
I should have clarified that, yes I do. – Sebaku Jan 30 '20 at 11:49
-
1If you have attempted this already, post your code and describe any errors you encounter. If you have not attempted this already, try it and then ask a question in accordance with SO's guidelines on asking questions. – cameron1024 Jan 30 '20 at 11:49
-
1Last 30 values or all the values that came in the last 30 seconds? These are two very different problems with very different solutions. – default locale Jan 30 '20 at 11:49