Answer the question
In order to leave comments, you need to log in
Performance MySQL connector for .NET, discuss?
Recently, when translating a project from .net core 3.1 to 5.0, I decided to switch from Pomelo.EntityFrameworkCore.MySql to the official MySQL connector (MySql.Data.MySqlClient) and came across a sharp drop in application performance.
Interested and tested. The difference in data proofreading speed was 10-30 times depending on the test conditions.
The tests were carried out on a local basis and on a simple request to minimize delays from the MySQL server. Tested on Windows and Ubuntu, on .net core 3.1 and .net core 5 - the results are comparable.
Here is the test code, it is the same for both libraries.
List<uint> ids = new List<uint>();
using (MySqlConnection connection = new MySqlConnection(str))
{
connection.Open();
DateTime now = DateTime.Now;
using (MySqlCommand cmd = new MySqlCommand("SELECT * FROM Transactions;", connection))
using (MySqlDataReader reader = cmd.ExecuteReader())
while (reader.Read())
ids.Add(reader.GetUInt32("ID"));
Console.WriteLine("Loaded " + ids.Count + " items. App working time = " + (DateTime.Now - now).TotalSeconds + " sec");
}
Answer the question
In order to leave comments, you need to log in
Compare the connection in both tests that they create there by default, plus check only in the release. Well, yes, the official one is more slow and has fewer features in the field of integration with EF
The question applies primarily to .net developers!
Recently, when translating a project from .net core 3.1 to 5.0, I decided to switch from Pomelo.EntityFrameworkCore.MySql to the official MySQL connector (MySql.Data.MySqlClient) and came across a sharp drop in application performance.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question