Repository navigation
Conversation
Otherwise a race condition could happen, like so: ``` /home/runner/work/ruby-pg/ruby-pg/spec/pg/tuple_spec.rb:316: [BUG] Segmentation fault at 0x0000000000000028 ruby 3.1.7p261 (2025-03-26 revision 0a3704f218) [x86_64-linux] -- Control frame information ----------------------------------------------- c:0004 p:---- s:0014 e:000013 CFUNC :each c:0003 p:---- s:0011 e:000010 CFUNC :to_h c:0002 p:0004 s:0007 e:000006 BLOCK /home/runner/work/ruby-pg/ruby-pg/spec/pg/tuple_spec.rb:316 [FINISH] c:0001 p:---- s:0003 e:000002 (none) [FINISH] ```
Materialize PG::Tuple objects when freezing and undef PG::Tuple.new
PostgreSQL prints IPv4-mapped and IPv4-compatible IPv6 addresses in dotted form, like ::ffff:1.2.3.4. The decoder chose AF_INET whenever the text contained a dot, so inet_pton() rejected these values and decoding raised TypeError. Choose AF_INET6 when the text contains a colon instead.
Decode IPv4-mapped IPv6 addresses in PG::TextDecoder::Inet
Duel (https://github.com/sferik/duel-ruby) runs the benchmarks in duel/ on the branch and on master side by side, and fails a pull request that is slower or allocates more. The 44 benchmarks cover queries over a socket to a PostgreSQL server of each worker's own (exec, exec_params, exec_prepared, COPY in and out), reading results in memory (values, getvalue, each, each_row, tuples, field names), the type maps, the text and binary coders on their own, escaping, and parsing connection parameters. Each version compiles its own extension (c.build). The duel-postgresql plugin needs a released pg, so Duel is in an optional Gemfile group. Checked by comparing master with itself three times, and with planted regressions: the Integer decoder without its fast path failed 6 benchmarks on instructions, and an extra rb_str_dup in the String decoder failed 13 on allocations.
sferik
force-pushed
the
duel-0.2-ci-test
branch
from
November 16, 2026 19:03
7bb1baa to
a8ef245
Compare
pg's code paths differ by system, and Linux's was the only one Duel measured. The Perf workflow runs on Linux, macOS and Windows now, each saying what it found in a report of its own, and the Perf comment workflow comments with all three. On Linux and macOS, it calls Duel 0.2.0's reusable workflow, so the copy of its steps is gone. Its steps are Unix shell's, so the Windows job runs the same ones itself, in bash, with what pg's build needs there as source-gem.yml has it (MSYS2's gcc, and PostgreSQL's binaries). The Perf comment workflow calls Duel's reusable one too.
sferik
force-pushed
the
duel-0.2-ci-test
branch
from
November 16, 2026 19:13
a8ef245 to
9313238
Compare
Owner
Author
|
Done: the workflows are on ged#771 now. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A test of the workflows for ged#771, before they go there. I'll close it once they pass.