-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
51 lines (45 loc) · 1.81 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
using BenchmarkDotNet.Running;
using System.Threading.Tasks;
namespace Stellar.Benchmarking
{
public class Program
{
private static async Task Main(string[] args)
{
if (args.Length == 0 || args[0] == "benchmark")
{
// runs a BenchmarkDotNet test suite
BenchmarkConfiguration configuration = new BenchmarkConfiguration();
BenchmarkRunner.Run<InsertBenchmark>(configuration);
BenchmarkRunner.Run<DeleteBenchmark>(configuration);
BenchmarkRunner.Run<BulkBenchmark>(configuration);
BenchmarkRunner.Run<QueryBenchmark>(configuration);
BenchmarkRunner.Run<UpsertBenchmark>(configuration);
BenchmarkRunner.Run<FastDBPerformanceBenchmark>(configuration);
BenchmarkRunner.Run<FastDBRecordSizeBenchmark>(configuration);
BenchmarkRunner.Run<FastDBRecordCountBenchmark>(configuration);
}
else if (args[0] == "features")
{
// tests and validates all features used in the benchmark test
int runs = 1;
int n = 1000;
for (int i = 0; i < runs; i++)
await FastDBFeatures.Test(n);
for (int i = 0; i < runs; i++)
await LiteDBFeatures.Test(n);
for (int i = 0; i < runs; i++)
await SQLiteFeatures.Test(n);
#if(VistaDB)
for (int i = 0; i < runs; i++)
await VistaDBFeatures.Test(n);
#endif
}
else if (args[0] == "concurrency")
{
// subject FastDB to a concurrency stress test
await FastDBConcurrency.Test(writers: 500, readers: 500);
}
}
}
}