/
dev-npgsql
/
npgsql
Обзор
Документация
Войти
/
dev-npgsql
/
npgsql
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
test/Npgsql.Benchmarks/ReadRows.cs
30 строк
682 B
Nino Floris
Introduce bind operation on PgConverter surface (#6566)
11 май 2026, 20:01
Не верифицирован
11 май 2026, 20:01
0f4cfd8
Код
Авторство
О чём код?
using BenchmarkDotNet.Attributes; namespace Npgsql.Benchmarks; public class ReadRows { [Params(1, 10, 100, 1000)] public int NumRows { get; set; } NpgsqlConnection _conn = default!; NpgsqlCommand Command { get; set; } = default!; [GlobalSetup] public void Setup() { _conn = BenchmarkEnvironment.OpenConnection(); Command = new NpgsqlCommand($"SELECT generate_series(1, {NumRows})", _conn); Command.Prepare(); } [GlobalCleanup] public void Cleanup() => _conn.Dispose(); [Benchmark] public void Read() { using (var reader = Command.ExecuteReader()) while (reader.Read()) { } } }