-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Performance regression when getting multiple connections with r2d2::Pool
#3156
Comments
This is caused by broken #3159 addresses this. Can you verify that this solves the issue for you? |
r2d2::Pool
r2d2::Pool
I've changed the title to reflect the actual bug. Can confirm the bug is fixed with your PR. Thank you for debugging this 👍 |
r2d2::Pool
r2d2::Pool
Our `R2D2Connection::is_broken` implementations where broken in such a way that they marked any valid connection as broken as soon as it was checked into the pool again. This resulted in the pool opening new connections everytime a connection was checked out of the pool, which obviously removes the possibility of reusing the same connection again and again. This commit fixes that issue and adds some tests to ensure that we do not break this again in the future.
Setup
Versions
Feature Flags
Problem Description
As is reported in #3144, performance regression is observed when upgrading
diesel
fromv1.4.8
tov2.0.0-rc0
. Aggregation queries (e.g.count(*)
are particularly affected, while the performance hit on normal queries is minimal.What are you trying to accomplish?
What is the expected output?
The performance of
v2.0.0-rc0
should be on par withv1.4.8
.What is the actual output?
cargo bench
output oftable.filter(id.eq(1)).count().get_result()
:Are you seeing any additional errors?
Steps to reproduce
The minimal reproduction sample is here.
Checklist
closed if this is not the case)
The text was updated successfully, but these errors were encountered: