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

Don't read from socket when data is pending in conn.block #445

Merged
merged 1 commit into from Mar 10, 2022

Conversation

larskanis
Copy link
Collaborator

conn.block still reads data from the socket, but only after checking the result queue and waiting for readability first. Reading data from the socket (PQconsumeInput) takes much more time than just checking available results (PQisBusy). So doing it as a precaution to conn.block is a performance issue, now that we call block before each get_result in pg-1.3.x.

The test was introduced in commit 09bdc16 . It is not particular specific to conn.block, so that we can check the error class on consume_input equaly.

Fixes #442

conn.block still reads data from the socket, but only after checking the result queue and waiting for readability first.
Reading data from the socket (PQconsumeInput) takes much more time than just checking available results (PQisBusy).
So doing it as a precaution to conn.block is a performance issue, now that we call block before each get_result in pg-1.3.x.

The test was introduced in commit 09bdc16 .
It is not particular specific to conn.block, so that we can check the error class on consume_input equaly.

Fixes #442
@larskanis larskanis merged commit 9d3b1df into master Mar 10, 2022
@larskanis larskanis deleted the block-without-consume branch March 10, 2022 06:34
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.

Severe Performance Decrease in 1.3.0 when using set_single_row_mode
1 participant