Reduce the instruction overhead of OpenSSL calls
Hackorum builds and tests every patch posted to the lists, not only commitfest submissions. This is Hackorum's own CI rather than the PostgreSQL project's, and it is still under testing - please report anything that looks wrong.
You can run a PostgreSQL built from this patch straight from Docker, with no checkout and no build:
docker run --rm -p 5432:5432 ghcr.io/hackorum-dev/postgres-patch:t51147psql -h localhost -U postgresBuilt from patchset v1 (message #1), September 20, 2026 at 03:52 AM.
Every patchset is also pushed to a branch of our PostgreSQL fork, so you can check out the same tree CI built. Without a PostgreSQL checkout:
git clone --branch t51147_1 https://github.com/hackorum-dev/postgres.gitIn a checkout you already have, add the fork once:
git remote add hackorum https://github.com/hackorum-dev/postgres.gitthen, for this patchset and every later one:
git fetch hackorum t51147_1 && git checkout t51147_1Patchset v1 (message #1) is on t51147_1
Hi,
From the openssl documentation, when the value of ret is greater than 0, the SSL_get_error() function returns SSL_ERROR_NONE.
So, it seems that when the return value of SSL_read() or SSL_write() function is greater than 0, we don't need to make an error judgment.
The attached patch attempts to reduce unnecessary error judgments.
I am glad for feedback and reviews!
腾讯
ryanewang 研发四组员工
On 27 Feb 2025, at 14:16, ryanewang(王蕾) <ryanewang@tencent.com> wrote:
Hi,
From the openssl documentation, when the value of ret is greater than 0, the SSL_get_error() function returns SSL_ERROR_NONE.
So, it seems that when the return value of SSL_read() or SSL_write() function is greater than 0, we don't need to make an error judgment.
The attached patch attempts to reduce unnecessary error judgments.
Calling SSL_get_error() is needed to clear the error queue for subsequent IO
operations, so I don't skipping it would be wise. I imagine that any overhead
is dwarfed by the time spent in network IO anyways.
--
Daniel Gustafsson