Re: [go-nuts] Map with expiration

2024-10-09 Thread robert engels
My project github.com/robaho/go-concurrency-test may be of interest in evaluating this. The timings are old, but AFAIK the analysis still holds. > On Oct 9, 2024, at 2:05 PM, Cleberson Pedreira Pauluci > wrote: > > I'm wondering if using sync.Map

Re: [go-nuts] Map with expiration

2024-10-09 Thread Cleberson Pedreira Pauluci
I'm wondering if using *sync.Map* wouldn't be the best option for performance reasons for this application, since it's a specialized map implementation. Does anyone know anything about this? Em quarta-feira, 9 de outubro de 2024 às 15:27:09 UTC-3, robert engels escreveu: > The best way (imo)

Re: [go-nuts] Map with expiration

2024-10-09 Thread robert engels
The best way (imo) to perform the compaction is to use multiple sub maps - i.e. partition the keys - and then you can compact these using RW locks to limit the stop the world. > On Oct 9, 2024, at 1:07 PM, Nico Braun wrote: > > I started thinking about the compaction, and if there was a way to

[go-nuts] Map with expiration

2024-10-07 Thread Alex Pliutau
In some cases your application doesn’t need Redis, and internal in-memory map with locks and expiration will suffice. For example you already know the size of the map and you don’t need to store a lot of data. Use cases could be IP rate limiting, or any other short-lived data. Here is how you