Skip to content

Measure busd's time limit on its sends, and zruntime's lazy time-limit clock - #4

Merged
zeenix merged 15 commits into
mainfrom
ccr-314882eb-9cvuxt
Oct 24, 2026
Merged

zeenix merged 15 commits into
mainfrom
ccr-314882eb-9cvuxt

Conversation

@zeenix

@zeenix zeenix commented Oct 24, 2026 •

Copy link
Copy Markdown
Owner

The tools and results behind z-galaxy/busd#382, which replaces busd's queue for each client with a time limit on each send, and z-galaxy/zruntime#58, which starts the clock of a time limit only once its future has to wait.

The measured busd commits (41407f0 to 7f3ba5a) were on the ccr-314882eb-9cvuxt branch of zeenix/busd, which has since been rebased onto busd's main for z-galaxy/busd#382. compare-send-timeout.sh fetches them by their full hashes, which GitHub still gives, so name one that the branch no longer has in full.

Generated by Claude Opus 5.5.

zeenix added 13 commits October 22, 2026 14:25
The client of the benchmark makes method calls. This one broadcasts
signals instead: a burst of 40000 to one subscriber, and then 4000 to
20 subscribers at once, each of which checks that it gets every signal,
in order. It prints the time that each phase takes as the other client
does, so that scripts/compare-brokers.py runs it as it is: the burst
as the single client, and the 20 subscribers as the simultaneous ones.

With more than one binary in the crate, `cargo run` needs to be told
which one to run by default: the benchmark of the README.

Assisted-by: Claude Opus 5.5 (claude-opus-5-5)
It prints, as JSON, the distribution of how long a method call takes,
one at a time with a small payload and from 20 clients at once with the
16 KiB of the benchmark, and of how long a signal broadcast to 20
subscribers takes to reach them, in a burst.

Assisted-by: Claude Opus 5.5 (claude-opus-5-5)
The some-changes branch has 100 proxies on one connection call the
object that the same connection serves, which hung against busd with
the client on zbus 4.3. This is that phase on zbus 6, followed by one
of 100 connections that call themselves, in the output format of the
benchmark, so that scripts/compare-brokers.py runs it as it is: the
shared connection as the single client. $DBUS_BENCH_CLIENTS sets how
many there are of each.

Assisted-by: Claude Opus 5.5 (claude-opus-5-5)
It runs the latency client against each broker in turn, round after
round, as scripts/compare-brokers.py runs the benchmark, whose code it
reuses, and records the latencies along with what the broker cost.

Assisted-by: Claude Opus 5.5 (claude-opus-5-5)
Each round of the comparison scripts runs every broker once, so the
runs of two brokers in a round make a pair. It gives the difference
between the two, in percent, for each metric, with a bootstrap
confidence interval over the pairs, and says whether the difference is
within a margin, beyond it, or neither for sure.

Assisted-by: Claude Opus 5.5 (claude-opus-5-5)
A branch of busd reverts the queue for each client of
z-galaxy/busd#376 and gives each send to a client a time limit instead.
This compares it with busd's main branch, with the revert alone and
with dbus-broker: in pairs, on the benchmark, on signals, on latencies
and on a connection that 100 proxies share, on zbus 6, and on clients
that stop reading, as frozen subscribers of the bus's signals and as
the shared connection of the zbus 4.3 client. Along with an experiment
with reading more messages ahead from each client.

Assisted-by: Claude Opus 5.5 (claude-opus-5-5)
results/2026-10-22-busd-send-timeout-xeon-4vcpu.md compares builds of
busd against each other and against dbus-broker, and making them all,
as its instructions had it, took several steps for each build.
scripts/compare-send-timeout.sh does all of it, as
scripts/compare-busd-builds.sh does for its comparison: it fetches the
commits that the checkouts lack, makes the builds from exports of them
under $WORK, builds the clients, runs the two scripts of the results and
packs what they write.

Those two scripts now take the builds by name rather than by commit,
take the commits for the results from the environment, leave dbus-broker
and the test with frozen subscribers out where what they need is
missing, and read how many rounds, calls and repeats to make from the
environment, so that a short run can check that everything works.

Assisted-by: Claude Opus 5.5 (claude-opus-5-5)
The branch of zeenix/busd has gone on from the commit with a time limit
of 1 s on each send to one of 100 ms, with the sends of each message to
all of its recipients at once. TIMEOUT_REV now names the commit that
scripts/compare-send-timeout.sh builds as the timeout, and as the base
of the read-ahead build, so that the same comparison measures either.

Assisted-by: Claude Opus 5.5 (claude-opus-5-5)
…ends

The branch of zeenix/busd that gives each send to a client a time limit
now sends a message to all of its recipients at once, and has a time
limit of 100 ms rather than 1 s. This compares it with busd's main
branch and with the time limit of 1 s, in pairs, on the benchmark,
signals, latencies and a connection that 100 proxies share, and on
clients that stop reading: frozen subscribers of the bus's signals, and
the shared connection of the zbus 4.3 client.

Assisted-by: Claude Opus 5.5 (claude-opus-5-5)
scripts/compare-send-timeout.sh wrote its results to the same directory
and archive in $WORK on every run, which it emptied first, so a run with
another TIMEOUT_REV threw away the results of the run before it. They
now go to send-timeout-results-COMMIT, COMMIT being the short hash of
the timeout commit, which the script also resolves to its full hash for
the results to name, as TIMEOUT_REV may give a short one.

Assisted-by: Claude Opus 5.5 (claude-opus-5-5)
busd's time limit on each send goes through zruntime's timeout(), which
reads the clock on every call, where the clock can be slow to read, as
it is with the HPET clocksource. A commit of zeenix/zruntime reads it
only once a send has to wait. To measure such a commit, ZRUNTIME_REV now
has scripts/compare-send-timeout.sh build busd's main branch and the
timeout commit on it, and the timeout commit on the commit before it,
each with an export of that commit of zruntime in place of the release
in its lock file. It then runs only the paired comparisons, between
those three builds, without the read-ahead build and the clients that
stop reading.

Assisted-by: Claude Opus 5.5 (claude-opus-5-5)
A run of scripts/compare-send-timeout.sh with ZRUNTIME_REV compared
busd's three builds on a commit of zruntime with each other only. Some
of their differences, such as on the connection that 100 proxies share,
only make sense next to what the other brokers do with the same clients.
That run now has dbus-broker and dbus-daemon in its paired comparisons
too, as far as they are installed, each compared with the baseline and
the timeout build. It takes about 45 minutes rather than 28 on a 4-vCPU
Xeon VM.

Assisted-by: Claude Opus 5.5 (claude-opus-5-5)
The run of scripts/compare-send-timeout.sh with TIMEOUT_REV=7f3ba5a and
ZRUNTIME_REV=99e2ebd on a Ryzen 7 7840U, whose clocksource is the HPET:
busd's main and its time limit of 100 ms, both on the commit of zruntime
that reads the clock only once a send has to wait, the time limit on the
commit before it, dbus-broker and dbus-daemon, on calls, signals,
latencies and a connection that 100 proxies share.

Assisted-by: Claude Opus 5.5 (claude-opus-5-5)

@zeenix zeenix left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested.

Review by Codex on behalf of @zeenix.

The reproduction script aborts on a fresh checkout because fetching the rebased branch does not retrieve the pinned revisions it needs.

Comment thread scripts/compare-send-timeout.sh Outdated
The branch of zeenix/busd that had the commits that the comparison of
busd's time limit measures was rebased onto busd's main, for
z-galaxy/busd#382, so fetching the branch no longer brings them, and
scripts/compare-send-timeout.sh stopped on a fresh checkout of busd. It
now fetches each commit by its full hash, which GitHub still gives, and
falls back to the branch only for a short hash, which a fetch cannot
name. A short hash of a commit that the branch no longer has fails with
a message that says to name the commit in full.

A run with ZRUNTIME_REV no longer needs the revert, which it does not
build. And as the head of busd's branch now patches zruntime itself, for
a commit that no release has, the patch of a run with ZRUNTIME_REV goes
in the Cargo configuration of the export, which takes precedence over
the manifest, rather than in a second patch of zruntime in the manifest,
which Cargo rejects as a duplicate key.

Assisted-by: Claude Opus 5.5 (claude-opus-5-5)

@zeenix zeenix left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No blocking findings.

Review by Codex on behalf of @zeenix.

One small correction remains in the script's usage example.

Comment thread scripts/compare-send-timeout.sh Outdated
The examples of scripts/compare-send-timeout.sh, and the commands that
the results give to reproduce them, named busd's commits by short
hashes, which the script can no longer fetch since the branch that had
them was rebased: it fetches a commit by its full hash, and only looks
for a short one on that branch. They now name the commits in full,
zruntime's too, so that they work as copied on a fresh checkout.

Assisted-by: Claude Opus 5.5 (claude-opus-5-5)

@zeenix zeenix left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No actionable findings.

Review by Codex on behalf of @zeenix.

@zeenix
zeenix merged commit 93c3f50 into main Oct 24, 2026
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