Skip to content

Test: Duel 0.3.0 on Linux, macOS and Windows - #3

Closed
sferik wants to merge 3 commits into
duel-ci-basefrom
duel-0.3-ci-test
Closed

sferik wants to merge 3 commits into
duel-ci-basefrom
duel-0.3-ci-test

Conversation

@sferik

@sferik sferik commented Nov 20, 2026

Copy link
Copy Markdown
Owner

A test of ged/ruby-pg's Perf workflow with Duel 0.3.0, the Windows job now a call of Duel's reusable workflow. I'll close it once it runs.

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.
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. It grants contents: write, which GitHub
checks every job of the reusable workflow against, though none of the
jobs that write is turned on here, and the Duel job still only reads.
The reusable workflow's 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, for
libpq). Its servers are the runner's own PostgreSQL's, whose initdb
drops the rights of the runner's user, an administrator, as postgres
needs: the binaries' doesn't. The Perf comment workflow calls Duel's
reusable one too.
Duel 0.3.0's reusable workflow runs on Windows (its steps in bash,
with setup-after-ruby for what needs Ruby's devkit), so the Windows
job is a call of it like Linux's and macOS's, in place of a copy of
its steps: setup downloads PostgreSQL's binaries, for libpq, and
names the runner's own postgres, in PGBIN, for the servers
(DUEL_POSTGRESQL_SERVER, as duel-postgresql 0.3.0 names what was
DUEL_POSTGRESQL_BIN, a directory), and setup-after-ruby installs
MSYS2's gcc and puts the devkit's directories, then libpq's, on the
PATH.

Each Duel job grants contents: read alone, now that the jobs that
write for a push are a reusable workflow of Duel's own, which each
platform's push calls, with its report. And the Duel jobs no longer
take accept-label, as Duel reads it from .duel.rb itself. The
Gemfile's optional group asks for Duel 0.3.0 and duel-postgresql
0.3.0.
@sferik

sferik commented Nov 20, 2026

Copy link
Copy Markdown
Owner Author

Done: it ran.

@sferik sferik closed this Nov 20, 2026
@sferik
sferik deleted the duel-0.3-ci-test branch November 20, 2026 16:55
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.

1 participant