BloomFilter.NetCore icon indicating copy to clipboard operation
BloomFilter.NetCore copied to clipboard

ContainsAsync too slow

Open Huai-Ming opened this issue 5 years ago • 3 comments

I have 50 items to test the ContainsAsync of Redis filter. It took about 1.5 seconds. And 1000 items took 5 seconds. Its configuation is : Expected Elements:100000, errorate: 0.01. Could u pls tell my how to improve my performace?

Huai-Ming avatar Dec 04 '20 07:12 Huai-Ming

Thank you for your feedback. I will solve this problem as soon as possible

vla avatar Dec 18 '20 06:12 vla

Can you provide code snippets?

vla avatar Dec 18 '20 06:12 vla

            var bf = FilterRedisBuilder.Build<string>("localhost", "bftest", 100000, 0.01);

            var items = new List<string>();

            var count = 50;

            var rndNum = new Random(Guid.NewGuid().GetHashCode());

            for (int i = 0; i < count; i++)
            {
                items.Add(Helper.GenerateString(rndNum.Next(5, 30)));
            }

            await bf.AddAsync(items);

            var sw = Stopwatch.StartNew();

            await bf.ContainsAsync(items);

            Console.WriteLine(sw.Elapsed);
`
items  elapsed
50     00:00:00.0307170
1000   00:00:00.6043679

vla avatar Dec 18 '20 06:12 vla