Re: Support getrandom() for pg_strong_random() source
Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
From: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
To: Jacob Champion <jacob.champion@enterprisedb.com>
Cc: Michael Paquier <michael@paquier.xyz>, Daniel Gustafsson
<daniel@yesql.se>, Masahiko Sawada <sawada.mshk@gmail.com>, PostgreSQL
Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-07-29T16:38:30Z
Lists: pgsql-hackers
Jacob Champion <jacob.champion@enterprisedb.com> writes: > On Mon, Jul 28, 2025 at 6:30 PM Michael Paquier <michael@paquier.xyz> wrote: > >> Could getentropy() be more efficient at the end on most platforms, >> meaning that this could limit the meaning of having a GUC switch? > > I don't know. [2] implies that the performance comparison depends on > several factors, and falls in favor of OpenSSL when the number of > bytes per call is large [...] > [2] https://dotat.at/@/2024-10-01-getentropy.html Note that that test was done on an older Linux kernel without the vDSO implementation of getentropy(), so on newer kernel (>=6.11) and glibc (>= 2.41) versions the difference might be smaller or the other way around. - ilmari