高效保存最近的X个整数

huangapple 未分类评论59阅读模式
标题翻译

Efficient way to save last X amount of integers

问题

我获取各种数据,每秒更新一次。我需要编写一个函数,以给我某个属性最近 30 个值(最近 30 秒)的值。什么方法在占用内存最少的情况下保存最近 30 个值?30 秒之前的所有数据都可以丢弃。我需要每秒执行此操作 96,000 次。

英文翻译

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.

huangapple
  • 本文由 发表于 2020年1月30日 19:45:12
  • 转载请务必保留本文链接:https://java.coder-hub.com/59985336.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定