1452 Commits

Author SHA1 Message Date
mgravell ce8c85af4d copypasta 2.0.90 2021-04-29 12:19:34 +01:00
mgravell 3504109a5f Add Dapper logo 2021-04-29 12:11:13 +01:00
mgravell e26aa7b2d6 fix #1656 (git reorg) 2021-04-29 11:04:12 +01:00
Nick Craver abd625cbf8 Merge pull request #1626 from stevedesmond-ca/repodb-benchmark
Add basic RepoDB benchmark
2021-04-27 17:30:54 -05:00
Nick Craver afefded8cf Merge pull request #1642 from kant2002/kant/cleanup 2021-04-27 16:58:28 -05:00
Nick Craver eb43a57d38 Merge pull request #1646 from kant2002/kant/sqlmarshal
[SqlMarshal](https://github.com/kant2002/sqlmarshal) is NativeAOT friendly mini-ORM which uses source code generators.
2021-04-27 16:55:52 -05:00
Nick Craver 3a09cb668f Merge pull request #1615 from Rollerss/main 2021-04-27 16:48:06 -05:00
Andrii Kurdiumov bc334ca679 [Benchmarks] Add SqlMarshal benhmarks
[SqlMarshal](https://github.com/kant2002/sqlmarshal) is NativeAOT friendly mini-ORM which uses source code generators.

```
// * Summary *

BenchmarkDotNet=v0.12.1, OS=Windows 10.0.19042
Intel Core i7-6700HQ CPU 2.60GHz (Skylake), 1 CPU, 8 logical and 4 physical cores
.NET Core SDK=5.0.201
  [Host]   : .NET Core 3.1.13 (CoreCLR 4.700.21.11102, CoreFX 4.700.21.11602), X64 RyuJIT
  ShortRun : .NET Core 3.1.13 (CoreCLR 4.700.21.11102, CoreFX 4.700.21.11602), X64 RyuJIT

|            ORM |                        Method |  Return |     Mean |    StdDev |     Error |   Gen 0 |  Gen 1 |  Gen 2 | Allocated |
|--------------- |------------------------------ |-------- |---------:|----------:|----------:|--------:|-------:|-------:|----------:|
|       Belgrade |                 ExecuteReader |    Post | 119.0 us |  22.26 us |  37.41 us |  2.6250 | 1.0000 |      - |  13.53 KB |
|     Hand Coded |                     DataTable | dynamic | 123.9 us |   2.95 us |   5.64 us |  3.0000 |      - |      - |   9.37 KB |
|     Hand Coded |                    SqlCommand |    Post | 124.8 us |  16.91 us |  32.33 us |  1.2500 | 0.5000 |      - |   7.42 KB |
|     SqlMarshal |                    SqlCommand |    Post | 132.8 us |   2.77 us |   4.66 us |  2.0000 | 0.7500 |      - |  11.27 KB |
|         Dapper |  QueryFirstOrDefault<dynamic> | dynamic | 135.0 us |   3.64 us |   6.96 us |  3.5000 |      - |      - |  11.39 KB |
|     LINQ to DB |                      Query<T> |    Post | 135.9 us |   3.52 us |   5.92 us |  1.7500 | 0.7500 |      - |  10.64 KB |
|     LINQ to DB |            'First (Compiled)' |    Post | 136.5 us |   2.99 us |   5.72 us |  1.7500 | 0.7500 |      - |  11.23 KB |
|       PetaPoco |             'Fetch<T> (Fast)' |    Post | 136.8 us |   4.67 us |   7.85 us |  2.0000 | 1.0000 |      - |  11.52 KB |
|         Dapper |   'Query<dynamic> (buffered)' | dynamic | 137.6 us |   6.44 us |  12.31 us |  2.0000 | 1.0000 |      - |  11.72 KB |
|         Mighty |                Query<dynamic> | dynamic | 141.7 us |   4.99 us |   9.54 us |  2.0000 | 1.0000 |      - |  12.43 KB |
|        Massive |             'Query (dynamic)' | dynamic | 142.1 us |   1.59 us |   2.66 us |  2.0000 | 1.0000 |      - |  12.07 KB |
|         Dapper |         'Query<T> (buffered)' |    Post | 143.0 us |   7.98 us |  13.41 us |  2.0000 | 1.0000 |      - |  11.64 KB |
|         Mighty |      SingleFromQuery<dynamic> | dynamic | 144.8 us |   3.95 us |   6.64 us |  2.5000 | 1.0000 |      - |  12.43 KB |
|         Dapper |        QueryFirstOrDefault<T> |    Post | 147.0 us |  22.39 us |  42.80 us |  1.7500 | 0.7500 |      - |  11.35 KB |
|       PetaPoco |                      Fetch<T> |    Post | 149.2 us |  22.91 us |  43.80 us |  2.5000 | 1.0000 | 0.2500 |   12.2 KB |
|         Dapper |              'Contrib Get<T>' |    Post | 149.9 us |  13.30 us |  25.42 us |  2.0000 | 1.0000 |      - |  12.28 KB |
|   ServiceStack |                 SingleById<T> |    Post | 151.8 us |   3.95 us |   7.56 us |  2.7500 | 1.0000 | 0.2500 |  15.27 KB |
|         Mighty |            SingleFromQuery<T> |    Post | 152.5 us |  14.77 us |  24.83 us |  2.0000 | 1.0000 |      - |  12.53 KB |
|         Mighty |                      Query<T> |    Post | 162.7 us |  45.49 us |  76.44 us |  2.0000 | 1.0000 |      - |  12.53 KB |
|         Dapper |       'Query<T> (unbuffered)' |    Post | 191.4 us |   6.95 us |  11.67 us |  2.2500 | 1.0000 | 0.2500 |  11.76 KB |
|     LINQ to DB |                         First |    Post | 200.6 us |  24.67 us |  47.18 us |  2.7500 | 1.0000 | 0.2500 |  15.79 KB |
| DevExpress.XPO |             GetObjectByKey<T> |    Post | 204.8 us |   5.69 us |  10.89 us |  5.5000 | 1.5000 |      - |  29.16 KB |
|        EF Core |            'First (Compiled)' |    Post | 212.4 us |  15.70 us |  30.01 us |  2.5000 |      - |      - |   8.39 KB |
|           EF 6 |                      SqlQuery |    Post | 251.1 us |  92.97 us | 140.55 us |  3.7500 | 1.0000 |      - |  23.67 KB |
|         Dapper | 'Query<dynamic> (unbuffered)' | dynamic | 255.9 us |  99.08 us | 149.80 us |  2.5000 | 1.0000 | 0.2500 |   11.8 KB |
| DevExpress.XPO |                      Query<T> |    Post | 285.4 us |  92.67 us | 140.10 us | 10.2500 |      - |      - |  31.71 KB |
|     NHibernate |                           HQL |    Post | 289.8 us |  18.26 us |  34.92 us |  5.5000 | 1.0000 |      - |  31.32 KB |
|     NHibernate |                        Get<T> |    Post | 302.1 us |  16.69 us |  28.05 us |  5.5000 | 1.0000 |      - |  29.37 KB |
|        EF Core |         'First (No Tracking)' |    Post | 334.9 us |  50.05 us |  84.11 us |  3.5000 | 0.5000 |      - |  19.53 KB |
|           EF 6 |                         First |    Post | 339.4 us |  43.67 us |  66.03 us | 14.0000 |      - |      - |  44.18 KB |
|        EF Core |                      SqlQuery |    Post | 344.0 us |  55.47 us |  83.86 us |  5.5000 |      - |      - |  17.59 KB |
|        EF Core |                         First |    Post | 357.5 us |  51.72 us |  78.20 us |  4.0000 |      - |      - |   12.3 KB |
|     NHibernate |                      Criteria |    Post | 357.6 us |  37.63 us |  63.23 us | 11.5000 | 1.0000 |      - |   56.5 KB |
|           EF 6 |         'First (No Tracking)' |    Post | 383.1 us |  33.98 us |  57.10 us |  9.0000 | 1.0000 |      - |  50.95 KB |
|     NHibernate |                           SQL |    Post | 399.2 us |  40.65 us |  68.31 us | 19.0000 | 1.0000 |      - |   78.9 KB |
| DevExpress.XPO |                 FindObject<T> |    Post | 602.5 us | 361.92 us | 547.18 us |  8.0000 |      - |      - |   27.2 KB |
|     NHibernate |                          LINQ |    Post | 925.9 us |  47.62 us |  80.02 us | 12.0000 | 2.0000 |      - |  53.59 KB |
```
2021-04-07 10:32:33 +06:00
Andrii Kurdiumov 252e8e0742 As far as I aware, Soma related code no longer in this project.
And thus can be removed
2021-04-01 08:40:59 +06:00
Steve Desmond f6825237f5 Add basic RepoDb benchmark 2021-02-17 14:32:50 -05:00
Rollerss 0366248861 Corrected typos 2021-02-01 21:57:53 -08:00
Nick Craver 6ec3804f2c Merge pull request #1604 from GitHubPang/main
Fix typos
2021-01-09 08:47:11 -05:00
GitHubPang e0f04e95ec Fix typos 2021-01-09 12:38:59 +08:00
Nick Craver 0561b616ba Merge pull request #1596 from royal/patch-1
Fix path to Dapper.Tests.Performance
2020-12-19 15:58:12 -05:00
Sam Royal 264eefa476 Update Readme.md
Fix path to Dapper.Tests.Performance
2020-12-17 14:14:14 +00:00
Marc Gravell 6ab170c160 .Net 5 (#1572)
* initial net5.0 tweaks; also fix current IDE warnings

* lib updates and fixes

* more cleanup

* fix snafu

* skip locals init

* disable xunit shadow copy in tests

* test records

* explore scenario that currently works re #1571
2.0.78
2020-11-17 09:57:17 +00:00
Nick Craver c773880c84 Merge pull request #1563 from Tyrrrz/patch-1
Update GitHubActionsTestLogger
2020-11-14 05:12:25 -05:00
Alexey Golub 7778f18f9f Update GitHubActionsTestLogger
Bumped GitHubActionsTestLogger to v1.1.2 as it fixes a few issues related to reporting in async tests.
https://github.com/Tyrrrz/GitHubActionsTestLogger/blob/master/Changelog.md#v112-26-oct-2020
2020-10-29 02:21:05 +02:00
Nick Craver aea488beb0 Merge pull request #1559 from StackExchange/craver/docker-bits
Let's get the first version of this going. If you want to try locally:
1. Start the servers (ensuring you have no conflicting port usage - shut down locals if so):
```bash
cd /tests/
docker-compose up
```
Run tests:
```bash
cd <repo root>
dotnet test Build.csproj
```
2020-10-23 16:10:33 -04:00
Nick Craver 009b4302dd Merge pull request #1560 from wswind/main
Remove an extra right parenthesis in literal replacements demo code.
2020-10-23 16:10:07 -04:00
Nick Craver acbd6f7ead Moar matching 2020-10-23 07:57:55 -04:00
Nick Craver 0e64c419ba Split test runs 2020-10-22 21:00:38 -04:00
Nick Craver 1c4f33d665 Fix TestMultiSelectWithSomeEmptyGrids on *nix 2020-10-22 20:59:16 -04:00
Nick Craver 453f9ed286 GODDAMMIT 2020-10-22 20:52:06 -04:00
Nick Craver c52bd401f0 Take 32 2020-10-22 20:38:41 -04:00
Nick Craver 72eb732f38 Woops 2020-10-22 20:28:07 -04:00
Nick Craver 7c1627be7f Fix container path 2020-10-22 20:17:40 -04:00
wswind 9c862af743 Update Readme.md
remove a right parenthesis in literal replacements demo code.
2020-10-19 10:43:13 +08:00
Nick Craver 0b0fdf51b3 Bump to 2019 2020-10-17 09:55:19 -04:00
Nick Craver 8d26e67c01 Tweaks! 2020-10-17 09:07:48 -04:00
Nick Craver 812b060b57 Merge pull request #1558 from paul42/patch-1
update tests link in readme
2020-10-17 08:56:56 -04:00
Nick Craver 3707223a1a Tweak docker bits
To test locally:
```
$env:SqlServerConnectionString = "Server=.;Database=tempdb;User Id=sa;Password=saAccountI#v3rySecure;"
$env:OLEDBConnectionString = "Provider=SQLOLEDB;Server=.;Database=tempdb;User Id=sa;Password=saAccountI#v3rySecure;"
$env:MySQLConnectionString = "server=localhost;Port=3306;Uid=root;Pwd=root;Database=test;Allow User Variables=true"
$env:PostgreSqlConnectionString = "Server=localhost;Port=5432;Database=test;User Id=postgres;Password=postgres;"
```
2020-10-17 08:53:44 -04:00
Paul.42 a6f99ced92 update tests link in readme 2020-10-16 15:07:42 -07:00
Nick Craver deadc1e3bb Start of Docker bits 2020-10-15 20:33:15 -04:00
Nick Craver cdc63c747e Merge pull request #1556 from StackExchange/craver/project-reorg1
One of several moves to make this something we can dev on all platforms and build on Actions for v3 onwards.

This leaves the main projects in the root, creating the following:
```
benchmarks\
    Dapper.Tests.Performance
    Directory.Build.props
tests\
    Dapper.Tests
    Dapper.Tests.Contrib
    Directory.Build.props
    Directory.Build.targets
```

Next step is getting `tests\docker-compose.yml` spun up for testing the various providers on GitHub Actions, but I'm having issues with this loaner laptop and the Docker restore from backup being in a screwy state.
2020-10-12 11:31:34 -04:00
Nick Craver 6dd097be41 Fix .sln file 2020-10-12 07:30:07 -04:00
Nick Craver 78ed4b2077 Tests: move into folders
One of several moves to make this something we can dev on all platforms and build on Actions for v3 onwards.
2020-10-11 14:56:35 -04:00
Nick Craver e2ffcdd1a4 Ignore JetBrains files 2020-08-18 21:54:34 -04:00
Nick Craver 97304d053e Merge pull request #1462 from DarkWanderer/patch-1
Add correct feature flag for ClickHouse
2020-07-31 16:45:19 -04:00
Nick Craver 942f91de86 Merge pull request #1507 from imba-tjd/patch-1
Readme: Fix Syntax error:
`Cannot apply indexing with [] to an expression of type 'IEnumerable<dynamic>'`
2020-07-31 16:42:09 -04:00
Nick Craver d2877e0400 Update Readme.md 2020-07-31 16:41:35 -04:00
Dogac Akyıldız e47d819d4e Fix Typo. (#1508) 2020-07-31 16:39:56 -04:00
谭九鼎 cea7a012b0 Fix Syntax error 2020-07-27 13:57:20 +08:00
Nick Craver e723ceed16 master -> main changes 2020-06-20 09:40:54 -04:00
Oleg V. Kozlyuk b17a989950 Add correct feature flag for ClickHouse
Properly indicate array support for ClickHouse connections
ClickHouse: https://clickhouse.tech/
ClickHouse .NET client: https://github.com/DarkWanderer/ClickHouse.Client
2020-05-12 01:12:12 +03:00
Damir Ainullin 4fb1ea29d4 Replace empty array with Array.Empty<T>, add compound assignment, fix of grammar typo (#1459)
Misc cleanup
2020-05-10 06:52:06 -04:00
Damir Ainullin 2bc267f529 Fixes of grammar typos (#1458)
Fixes of grammar typos
2020-05-09 16:00:24 -04:00
Damir Ainullin f4aec37711 Replace sync methods calls with async analogs (#1457)
Replace sync methods calls with async analogs
2020-05-08 18:01:02 -04:00
Damir Ainullin d403fa5b54 Removed excessive casts (#1452)
Removed excessive casts
2020-05-07 07:22:25 -04:00
Nick Craver 3371bf2b7f Normalize deserialization errors for bad data (#1453)
This normalizes all the cases of trying to set null to non-null things and giving a better exception when it happens. Today when a user does something like this:

```cs
conn.QueryFirstOrDefault<int>("Select null;");
```
...we'll get a null ref in the `(T)val;` portion of the deserialization pass. It's not very intuitive as to what's gone wrong. The same is true for value tuples and all `Query*<T>()` methods. However, we handle this in a much friendlier way in the generated type deserializers (already, in master) with a message like:
> Error parsing column 1 (Foo=bar - String)

This gives the type we _actually_ got for the column and the position it was in. This PR improves the case for anything from `Query<int>` to `QueryFirst<int>`, etc. We could be more intuitive _if we passed the expected type in_ (which we don't today via the IL Path), or if we can come up with a generic error message along the lines of "... - use a nullable type (e.g. `int?` instead of `int`) if null is expected.". Or something like that - thoughts?

We're using `DataException` because that's what we're already doing on type deserialization in the default paths. That's the generic exception type that'll always work (it's not always a cast or parsing exception...it could be either)...and since it's already in use, sticking with it here.

Overall changes:
- DRYs up `QueryRowImpl<T>` and `QueryRowAsync<T>` (single row paths) - into `ReadRow<T>`
- DRYs up value setting code between `Query<T>`, `QueryAsync<T>`, `QueryRowImpl<T>`, `QueryRowAsync<T>` - into `GetValue<T>`
- When trying to set a null to a non-nullable type, it'll throw a much better exception.
- Adds tests to ensure these error messages are consistent.

Theoretical breaking change:
- Someone's doing this and catching null ref exceptions or string format exceptions. If that's the case, we'll change their exception expectations here - I think in net we should still do this.

Related to:
- #567
- #1421
- #1440 

### TODO
- [ ] ValueTuple support - these are handled in yet another path and still throw a different casting error. Note: they won't throw a null error because that's a column and we won't set it - unless `.ApplyNullValues` is set in settings.


### Benchmarks:
```ini
BenchmarkDotNet=v0.12.1, OS=Windows 10.0.19041.208 (2004/?/20H1)
Intel Core i7-7700HQ CPU 2.80GHz (Kaby Lake), 1 CPU, 8 logical and 4 physical cores
.NET Core SDK=3.1.201
  [Host]   : .NET Core 3.1.3 (CoreCLR 4.700.20.11803, CoreFX 4.700.20.12001), X64 RyuJIT
  ShortRun : .NET Core 3.1.3 (CoreCLR 4.700.20.11803, CoreFX 4.700.20.12001), X64 RyuJIT
```

#### Before (3 runs)
|    ORM |                        Method |  Return |     Mean |  StdDev |   Error |  Gen 0 |  Gen 1 |  Gen 2 | Allocated |
|------- |------------------------------ |-------- |---------:|--------:|--------:|-------:|-------:|-------:|----------:|
| Dapper |  QueryFirstOrDefault<dynamic> | dynamic | 117.4 us | 1.62 us | 2.46 us | 3.6250 |      - |      - |  11.39 KB |
| Dapper |         'Query<T> (buffered)' |    Post | 119.4 us | 0.58 us | 0.88 us | 1.8750 | 0.8750 |      - |  11.65 KB |
| Dapper |        QueryFirstOrDefault<T> |    Post | 120.7 us | 0.78 us | 1.30 us | 1.8750 | 0.8750 |      - |  11.35 KB |
| Dapper |   'Query<dynamic> (buffered)' | dynamic | 125.0 us | 2.62 us | 4.41 us | 2.5000 | 1.0000 | 0.2500 |  11.73 KB |
| Dapper |              'Contrib Get<T>' |    Post | 127.8 us | 3.19 us | 4.82 us | 2.5000 | 1.0000 | 0.2500 |  12.29 KB |
| Dapper |       'Query<T> (unbuffered)' |    Post | 160.8 us | 1.19 us | 2.28 us | 2.0000 | 1.0000 |      - |  11.77 KB |
| Dapper | 'Query<dynamic> (unbuffered)' | dynamic | 170.6 us | 1.71 us | 2.58 us | 2.0000 | 1.0000 |      - |  11.81 KB |

|    ORM |                        Method |  Return |     Mean |  StdDev |   Error |  Gen 0 |  Gen 1 |  Gen 2 | Allocated |
|------- |------------------------------ |-------- |---------:|--------:|--------:|-------:|-------:|-------:|----------:|
| Dapper |  QueryFirstOrDefault<dynamic> | dynamic | 114.5 us | 1.81 us | 2.73 us | 3.6250 |      - |      - |  11.39 KB |
| Dapper |        QueryFirstOrDefault<T> |    Post | 117.9 us | 0.93 us | 1.56 us | 1.8750 | 0.8750 |      - |  11.35 KB |
| Dapper |   'Query<dynamic> (buffered)' | dynamic | 121.3 us | 1.52 us | 2.55 us | 2.5000 | 1.0000 | 0.2500 |  11.73 KB |
| Dapper |         'Query<T> (buffered)' |    Post | 122.7 us | 1.09 us | 2.08 us | 2.0000 | 1.0000 |      - |  11.65 KB |
| Dapper |              'Contrib Get<T>' |    Post | 127.9 us | 1.40 us | 2.12 us | 2.5000 | 0.7500 | 0.2500 |  12.29 KB |
| Dapper |       'Query<T> (unbuffered)' |    Post | 166.9 us | 1.02 us | 1.71 us | 2.0000 | 1.0000 |      - |  11.77 KB |
| Dapper | 'Query<dynamic> (unbuffered)' | dynamic | 170.1 us | 2.19 us | 3.31 us | 2.0000 | 1.0000 |      - |  11.81 KB |

|    ORM |                        Method |  Return |     Mean |  StdDev |   Error |  Gen 0 |  Gen 1 |  Gen 2 | Allocated |
|------- |------------------------------ |-------- |---------:|--------:|--------:|-------:|-------:|-------:|----------:|
| Dapper |  QueryFirstOrDefault<dynamic> | dynamic | 115.5 us | 3.14 us | 4.75 us | 3.6250 |      - |      - |  11.39 KB |
| Dapper |        QueryFirstOrDefault<T> |    Post | 121.5 us | 4.29 us | 7.21 us | 1.8750 | 0.8750 |      - |  11.35 KB |
| Dapper |         'Query<T> (buffered)' |    Post | 123.9 us | 2.16 us | 3.27 us | 2.0000 | 1.0000 |      - |  11.65 KB |
| Dapper |   'Query<dynamic> (buffered)' | dynamic | 127.0 us | 3.65 us | 5.52 us | 2.3750 | 0.8750 | 0.3750 |  11.73 KB |
| Dapper |              'Contrib Get<T>' |    Post | 130.0 us | 3.18 us | 4.80 us | 2.5000 | 0.7500 | 0.2500 |  12.29 KB |
| Dapper | 'Query<dynamic> (unbuffered)' | dynamic | 166.7 us | 1.39 us | 2.33 us | 2.7500 | 1.0000 | 0.2500 |  11.81 KB |
| Dapper |       'Query<T> (unbuffered)' |    Post | 170.6 us | 2.18 us | 3.29 us | 2.2500 | 1.0000 | 0.2500 |  11.77 KB |

#### After (3 runs):
|    ORM |                        Method |  Return |     Mean |  StdDev |   Error |  Gen 0 |  Gen 1 |  Gen 2 | Allocated |
|------- |------------------------------ |-------- |---------:|--------:|--------:|-------:|-------:|-------:|----------:|
| Dapper |  QueryFirstOrDefault<dynamic> | dynamic | 113.2 us | 0.45 us | 0.75 us | 3.6250 |      - |      - |  11.39 KB |
| Dapper |   'Query<dynamic> (buffered)' | dynamic | 118.7 us | 1.97 us | 2.98 us | 1.8750 | 0.8750 |      - |  11.72 KB |
| Dapper |        QueryFirstOrDefault<T> |    Post | 119.6 us | 1.12 us | 1.88 us | 1.8750 | 0.8750 |      - |  11.35 KB |
| Dapper |         'Query<T> (buffered)' |    Post | 121.8 us | 4.16 us | 6.28 us | 2.5000 | 1.0000 | 0.2500 |  11.64 KB |
| Dapper |              'Contrib Get<T>' |    Post | 124.0 us | 1.21 us | 2.04 us | 2.0000 | 1.0000 |      - |  12.28 KB |
| Dapper |       'Query<T> (unbuffered)' |    Post | 162.4 us | 1.95 us | 3.27 us | 2.2500 | 1.0000 | 0.2500 |  11.76 KB |
| Dapper | 'Query<dynamic> (unbuffered)' | dynamic | 173.0 us | 2.68 us | 4.50 us | 2.5000 | 1.0000 | 0.2500 |   11.8 KB |

|    ORM |                        Method |  Return |     Mean |  StdDev |   Error |  Gen 0 |  Gen 1 |  Gen 2 | Allocated |
|------- |------------------------------ |-------- |---------:|--------:|--------:|-------:|-------:|-------:|----------:|
| Dapper |  QueryFirstOrDefault<dynamic> | dynamic | 114.1 us | 1.42 us | 2.15 us | 3.6250 |      - |      - |  11.39 KB |
| Dapper |        QueryFirstOrDefault<T> |    Post | 120.4 us | 1.23 us | 1.87 us | 1.8750 | 0.8750 |      - |  11.35 KB |
| Dapper |   'Query<dynamic> (buffered)' | dynamic | 121.4 us | 3.90 us | 5.90 us | 1.8750 | 0.8750 |      - |  11.72 KB |
| Dapper |         'Query<T> (buffered)' |    Post | 125.7 us | 1.65 us | 2.50 us | 2.0000 | 1.0000 |      - |  11.64 KB |
| Dapper |              'Contrib Get<T>' |    Post | 132.1 us | 3.01 us | 4.55 us | 2.2500 | 0.7500 |      - |  12.28 KB |
| Dapper | 'Query<dynamic> (unbuffered)' | dynamic | 162.1 us | 2.29 us | 3.85 us | 2.7500 | 1.0000 | 0.2500 |   11.8 KB |
| Dapper |       'Query<T> (unbuffered)' |    Post | 166.9 us | 2.19 us | 3.31 us | 2.2500 | 1.0000 | 0.2500 |  11.76 KB |

|    ORM |                        Method |  Return |     Mean |  StdDev |   Error |  Gen 0 |  Gen 1 |  Gen 2 | Allocated |
|------- |------------------------------ |-------- |---------:|--------:|--------:|-------:|-------:|-------:|----------:|
| Dapper |        QueryFirstOrDefault<T> |    Post | 114.1 us | 2.80 us | 4.23 us | 1.8750 | 0.8750 |      - |  11.35 KB |
| Dapper |         'Query<T> (buffered)' |    Post | 115.5 us | 1.30 us | 1.97 us | 2.6250 | 1.0000 | 0.3750 |  11.64 KB |
| Dapper |  QueryFirstOrDefault<dynamic> | dynamic | 120.8 us | 2.99 us | 4.53 us | 3.6250 |      - |      - |  11.39 KB |
| Dapper |   'Query<dynamic> (buffered)' | dynamic | 123.7 us | 3.61 us | 5.46 us | 2.0000 | 1.0000 |      - |  11.72 KB |
| Dapper |              'Contrib Get<T>' |    Post | 129.2 us | 2.79 us | 4.22 us | 2.0000 | 1.0000 |      - |  12.28 KB |
| Dapper |       'Query<T> (unbuffered)' |    Post | 163.0 us | 3.67 us | 6.17 us | 2.2500 | 1.0000 | 0.2500 |  11.76 KB |
| Dapper | 'Query<dynamic> (unbuffered)' | dynamic | 167.2 us | 0.73 us | 1.10 us | 2.2500 | 1.0000 |      - |   11.8 KB |

...in short: it's within the jitter on this laptop and no difference is discernable. It's worth looking at for performance because these are hot paths. I want to de-dupe the repeated code here, but given the hot path nature whether it inlines is important.
2020-05-07 07:21:39 -04:00