Hacker News new | past | comments | ask | show | jobs | submit login

I had thought about that but never got around to building a sliding window that worked that way. The challenge is that then the `events/0` call might return events outside the window of time. But there is a potential performance improvement if we don't have to always be removing old events one by one.

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...




Right, you'd end up returning one bucket too little, or one bucket too much, of your full time window, depending on what tradeoff you decided was OK to have.

And yeah, I was thinking of buckets as append-only lists that got dropped in their entirety when out of range.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: