feat(csharp): 2.0 xdb csharp client implementation

This commit is contained in:
Alan
2022-09-06 18:21:23 +08:00
parent 7d22a7d6ae
commit bdab0d8c6d
21 changed files with 684070 additions and 710 deletions

View File

@@ -0,0 +1,21 @@
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
using IP2Region.Net.XDB;
BenchmarkRunner.Run(typeof(Program).Assembly);
public class CachePolicyCompare
{
private readonly Searcher _contentSearcher = new Searcher(CachePolicy.Content);
private readonly Searcher _vectorSearcher = new Searcher(CachePolicy.VectorIndex);
private readonly string _testIpAddress = "114.114.114.114";
[Benchmark]
[BenchmarkCategory(nameof(CachePolicy.Content))]
public void CachePolicy_Content() => _contentSearcher.Search(_testIpAddress);
[Benchmark]
[BenchmarkCategory(nameof(CachePolicy.VectorIndex))]
public void CachePolicy_VectorIndex() => _vectorSearcher.Search(_testIpAddress);
}