I tested locally with dotnet test -c Release --filter="FullyQualifiedName~Identity.Dapper.Tests.Integration.MySQL". (The docker-compose setup described in the repo made testing very easy—thanks!)
This PR also removes a connection leak (that I observed when checking MySqlConnector logs); this could cause performance problems if the connections were being leaked faster than the connection pool was reclaiming them.
These results are very close; it looks like MySqlConnector could be slightly faster, although the difference is usually within the measured experimental error.
However, MySql.Data doesn't reset the connection by default, so you may hit MySQL bug 77421. This also means that MySqlConnector is doing extra work. If we enable ConnectionReset=true in the MySql.Data connection string (to get equivalent behaviour), we get the following timings for MySql.Data; now MySqlConnector is clearly 5‒6× faster.
Fixes #62.
I tested locally with
dotnet test -c Release --filter="FullyQualifiedName~Identity.Dapper.Tests.Integration.MySQL"
. (Thedocker-compose
setup described in the repo made testing very easy—thanks!)This PR also removes a connection leak (that I observed when checking MySqlConnector logs); this could cause performance problems if the connections were being leaked faster than the connection pool was reclaiming them.
I added a simple (read-only) benchmark and ran it before and after the MySqlConnector change (I included the connection leak change when benchmarking MySql.Data): https://github.com/mysql-net/Identity.Dapper/commit/517ffefd50da395b663dbbabe79ecbd5fd4c989c
MySql.Data
MySqlConnector
These results are very close; it looks like MySqlConnector could be slightly faster, although the difference is usually within the measured experimental error.
However, MySql.Data doesn't reset the connection by default, so you may hit MySQL bug 77421. This also means that MySqlConnector is doing extra work. If we enable
ConnectionReset=true
in the MySql.Data connection string (to get equivalent behaviour), we get the following timings for MySql.Data; now MySqlConnector is clearly 5‒6× faster.