bigcache icon indicating copy to clipboard operation
bigcache copied to clipboard

Get multiple items in a single function call

Open SebastienMelki opened this issue 3 years ago • 5 comments

Hello, I was wondering if bigcache could support a getMulti(keys []string) function or if there was a technical limitation preventing it.

Thanks!

SebastienMelki avatar Jul 19 '22 22:07 SebastienMelki

Hey, I think it's not a bug but enhancement. I thin it make sens to expose get/set for multiple items as it can boost performance as there will be only single lock. This may be useful to setup/backup the cache.

@cristaloleg WDYT?

janisz avatar Jul 21 '22 14:07 janisz

Hey, I think it's not a bug but enhancement. I thin it make sens to expose get/set for multiple items as it can boost performance as there will be only single lock. This may be useful to setup/backup the cache.

@cristaloleg WDYT?

Yea sorry the bug label came by default and I wasn't able to remove it. I completely agree @janisz , if you can point me to what I should look at I can take a jab at implementing the multi approach.

SebastienMelki avatar Jul 21 '22 14:07 SebastienMelki

Yeah, sounds good. With a multiget we can increase throughput because we will take lock once.

cristaloleg avatar Jul 21 '22 14:07 cristaloleg

Is this available?

raeidish avatar Oct 14 '23 18:10 raeidish

@raeidish looks so

cristaloleg avatar Oct 15 '23 10:10 cristaloleg