File tree Expand file tree Collapse file tree
src/FirebirdSql.Data.FirebirdClient.Benchmarks Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ /*
2+ * The contents of this file are subject to the Initial
3+ * Developer's Public License Version 1.0 (the "License");
4+ * you may not use this file except in compliance with the
5+ * License. You may obtain a copy of the License at
6+ * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt.
7+ *
8+ * Software distributed under the License is distributed on
9+ * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
10+ * express or implied. See the License for the specific
11+ * language governing rights and limitations under the License.
12+ *
13+ * All Rights Reserved.
14+ */
15+
16+ //$Authors = Jiri Cincura (jiri@cincura.net)
17+
18+ using System . Threading . Tasks ;
19+ using BenchmarkDotNet . Attributes ;
20+
21+ namespace FirebirdSql . Data . FirebirdClient . Benchmarks ;
22+
23+ [ Config ( typeof ( BenchmarkConfig ) ) ]
24+ public class ConnectionBenchmark : BenchmarkBase
25+ {
26+ [ GlobalSetup ]
27+ public void GlobalSetup ( )
28+ {
29+ CreateDatabase ( ) ;
30+ }
31+
32+ [ Benchmark ]
33+ public void OpenClose ( )
34+ {
35+ using var conn = new FbConnection ( ConnectionString ) ;
36+ conn . Open ( ) ;
37+ }
38+
39+ [ Benchmark ]
40+ public async Task OpenCloseAsync ( )
41+ {
42+ await using var conn = new FbConnection ( ConnectionString ) ;
43+ await conn . OpenAsync ( ) ;
44+ }
45+ }
You can’t perform that action at this time.
0 commit comments