Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Microsoft.Data.Sqlite: Avoid re-initialization of pooled connections #28966

Merged
merged 1 commit into from
Sep 2, 2022

Conversation

bricelam
Copy link
Contributor

@bricelam bricelam commented Sep 2, 2022

This simple benchmark goes from 5078 ms to 124.

using Dapper;
using Microsoft.Data.Sqlite;

using var connection = new SqliteConnection(
    "Data Source=test.db;Password=Password12!");

connection.Execute(
    "CREATE TABLE IF NOT EXISTS Data(Value)");

for (var i = 0; i < 10; i++)
{
    connection.Execute(
        "INSERT INTO Data VALUES (@Value)",
        new { Value = Random.Shared.Next() });
}

Fixes #28774

@bricelam bricelam requested a review from a team September 2, 2022 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Slow performance when commiting transaction to SQLite encrypted file
2 participants