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

Asynchronous Performance Speedups #58

Merged
merged 1 commit into from
Sep 21, 2016

Conversation

caleblloyd
Copy link
Contributor

This PR focuses on achieving maximum Asynchronous method throughput. It implements the following speedups:

  • Connection Pooling Open/Close methods to free up connections quicker (when connection pooling is used)
  • Asynchronous Transaction Commit/Rollback (requires MySqlConnector/0.1.0-alpha23)
  • Methods to close DbDataReaders once they are used up instead of waiting for Garbage Collection
  • Multi-Select statements that use Include are now wrapped in RepeatableRead transactions so that they get a consistent snapshot of the database

With this PR, Async behavior scales well without lock-ups. I am able to hit 500RPS in the performance tests and maintain under a 1s response time.

Copy link
Member

@yukozh yukozh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should only keep Relational in Connection, Command etc which like ado.net classes.
The others don't need keep the Relational.
QueryContext is included in LINQ, not ADO, so I think we should rename MySqlRelationalQueryContext to MySqlQueryContext

@@ -1,4 +1,4 @@
# Pomelo.EntityFrameworkCore.MySql
# Pomelo.EntityFrameworkCore.MySql
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the difference?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops, probably file encoding. removed from the commit

// ReSharper disable once CheckNamespace
namespace Microsoft.EntityFrameworkCore.Query
{
public class MySqlRelationalQueryContext : RelationalQueryContext
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MySqlQueryContext. No MySqlRelationalQueryContext.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

{
public bool HasInclude = false;

public MySqlRelationalQueryContext(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MySqlQueryContext

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

namespace Microsoft.EntityFrameworkCore.Query.Internal
{
public class MySqlRelationalQueryContextFactory : RelationalQueryContextFactory
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MySqlQueryContextFactory

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@caleblloyd
Copy link
Contributor Author

Code review changes complete

@yukozh yukozh merged commit c7ae60f into PomeloFoundation:master Sep 21, 2016
@caleblloyd caleblloyd deleted the f_performance branch September 21, 2016 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants