Skip to content

test(fspy-benchmark): add a contended access row - #679

Merged
wan9chi merged 1 commit into
claude/fspy-shm-capacity-envfrom
claude/fspy-bench-contended-row
Aug 18, 2026
Merged

test(fspy-benchmark): add a contended access row#679
wan9chi merged 1 commit into
claude/fspy-shm-capacity-envfrom
claude/fspy-bench-contended-row

Conversation

@wan9chi

@wan9chi wan9chi commented Aug 17, 2026

Copy link
Copy Markdown
Member

Motivation

The benchmark's thread count was one constant shared by every suite, fixed at two. Two threads represent a normal tracked process, but they barely make writers fight over the IPC channel's counters, and every recorded access costs two atomic read-modify-writes on words every other thread is touching. Changes to how a record is claimed can therefore look free here while costing real time under a parallel build.

The count moves onto the suite, so the existing rows keep their two threads and stay comparable with earlier runs, and a new access-contended row runs the same opens under eight. It halves the iterations over half the opens, so four times the threads cost about the same wall clock.

Split out of #675, where it was used to measure claim-path changes.

🤖 Generated with Claude Code

@github-actions

Copy link
Copy Markdown

fspy benchmark

linux

dynamic/launch             change  +0.23%  [ -2.45% ..  +3.19%]  overhead   +48.79%
dynamic/access             change  -0.13%  [ -0.83% ..  +0.53%]  overhead    +5.65%
dynamic/access-relative    change  +0.09%  [ -0.72% ..  +0.72%]  overhead   +45.74%
dynamic/access-contended   change  +0.65%  [ -1.53% ..  +3.34%]  overhead    +8.77%
static/launch              change  +0.45%  [ -3.87% ..  +5.78%]  overhead  +143.92%
static/access              change  +0.13%  [ -0.61% ..  +0.93%]  overhead  +808.73%
static/access-relative     change  -0.10%  [ -1.06% ..  +0.91%]  overhead +1309.98%
static/access-contended    change  +0.30%  [ -0.54% ..  +1.87%]  overhead +3500.24%

macos

dynamic/launch             change  +0.23%  [ -2.83% ..  +4.01%]  overhead  +221.75%
dynamic/access             change  +0.00%  [ -2.19% ..  +2.72%]  overhead    +4.52%
dynamic/access-relative    change  +0.38%  [ -4.42% ..  +5.66%]  overhead  +260.34%
dynamic/access-contended   change  -0.09%  [ -7.01% ..  +4.77%]  overhead    +2.88%

windows

dynamic/launch             change  -0.30%  [-11.46% ..  +9.86%]  overhead   +25.72%
dynamic/access             change  +0.33%  [ -2.54% ..  +3.09%]  overhead    +1.40%
dynamic/access-relative    change  -0.18%  [ -2.33% ..  +3.49%]  overhead    +1.11%
dynamic/access-contended   change  +0.52%  [ -1.71% .. +15.69%]  overhead    +2.51%

@wan9chi
wan9chi force-pushed the claude/fspy-bench-contended-row branch from 8fb8396 to e30b7f8 Compare August 18, 2026 02:38
@wan9chi
wan9chi changed the base branch from main to claude/fspy-shm-capacity-env August 18, 2026 02:38
The thread count was one constant shared by every suite, fixed at two —
enough to represent a normal tracked process, but not enough to make
writers fight over the channel's counters. Each record costs two atomic
read-modify-writes on words every other thread is touching, and two
threads barely provoke that.

The count moves onto the suite, so the existing rows keep their two
threads and their comparability, and a new `access-contended` row runs the
same opens under eight. It halves the iterations over half the opens, so
four times the threads cost about the same wall clock.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@wan9chi
wan9chi force-pushed the claude/fspy-bench-contended-row branch from e30b7f8 to 6339eba Compare August 18, 2026 02:39
@wan9chi
wan9chi merged commit 187994d into claude/fspy-shm-capacity-env Aug 18, 2026
3 checks passed
@wan9chi
wan9chi deleted the claude/fspy-bench-contended-row branch August 18, 2026 02:39
@wan9chi
wan9chi restored the claude/fspy-bench-contended-row branch August 18, 2026 02:41
wan9chi added a commit that referenced this pull request Aug 18, 2026
## Motivation

The benchmark's thread count was one constant shared by every suite,
fixed at two. Two threads represent a normal tracked process, but they
barely make writers fight over the IPC channel's counters, and every
recorded access costs two atomic read-modify-writes on words every other
thread is touching. Changes to how a record is claimed can therefore
look free here while costing real time under a parallel build.

The count moves onto the suite, so the existing rows keep their two
threads and stay comparable with earlier runs, and a new
`access-contended` row runs the same opens under eight. It halves the
iterations over half the opens, so four times the threads cost about the
same wall clock.

Split out of [#675](#675),
where it was used to measure claim-path changes. Replaces
[#679](#679), which GitHub
auto-closed and deleted the branch of when its base briefly absorbed
this commit.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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