Sliding Window Data Store in Erlang
stratus3d.com
stratus3d.com
My throughput benchmark does take this into account though. It attempts to add 100,000 events to a window that only keeps events for 10 seconds. Adding 100,000 events takes much longer than 10 seconds, so the out list will be repopulated a couple times before the test is complete. The throughput benchmark is only an average though... And a longer running throughput test would yield a more accurate average.
I will update the post with this information.
You'd end up quantizing the window, but.. dunno, just spitballing here.
I'll have to try improving the list implementation with "buckets"... I wonder if buckets could be represented as lists stored inside a tuple or another list...
And yeah, I was thinking of buckets as append-only lists that got dropped in their entirety when out of range.
Elixir is great, but I think a language like this would pull away so many Python guys from their migration to Go and Python3 and take Erlang to a new level.