/
dev-npgsql
/
npgsql
Обзор
Документация
Войти
/
dev-npgsql
/
npgsql
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
v5.0.18
test/Npgsql.Benchmarks/ConnectionCreationBenchmarks.cs
30 строк
883 B
Christopher Moore
Updated BenchmarkDotNet to support .NET 5
13 июн 2020, 15:53
Не верифицирован
13 июн 2020, 15:53
d94c2a0
Код
Авторство
О чём код?
using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Columns; using BenchmarkDotNet.Configs; using Microsoft.Data.SqlClient; // ReSharper disable UnusedMember.Global namespace Npgsql.Benchmarks { [Config(typeof(Config))] public class ConnectionCreationBenchmarks { const string NpgsqlConnectionString = "Host=foo;Database=bar;Username=user;Password=password"; const string SqlClientConnectionString = @"Data Source=(localdb)\mssqllocaldb"; [Benchmark] public NpgsqlConnection Npgsql() => new NpgsqlConnection(NpgsqlConnectionString); [Benchmark] public SqlConnection SqlClient() => new SqlConnection(SqlClientConnectionString); class Config : ManualConfig { public Config() { AddColumn(StatisticColumn.OperationsPerSecond); } } } }