Skip to content

ci: Benchmark the SDK with CodSpeed - #117

Merged
khvn26 merged 9 commits into
mainfrom
feat/codspeed
Oct 30, 2026
Merged

khvn26 merged 9 commits into
mainfrom
feat/codspeed

Conversation

@emyller

@emyller emyller commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Runs the Flagsmith SDK benchmarks against the SDK in CodSpeed. This covers 5 local evaluation scenarios × 3 environment document sizes (small, medium, large).

  • make benchmark runs the suite through the CodSpeed CLI in walltime mode. The benchmarks are listed in codspeed.yml.
  • benchmarks/ drives a locally evaluating client. The environment document is served from memory through a stub Faraday adapter, so the measurements don't include network time.
  • spec/sdk-benchmarks is added as a submodule pinned to 0.0.2, and benchmarks/ is left out of the gem.
  • The CodSpeed workflow runs on codspeed-macro runners and uploads results via OIDC.

Closes SDK-16.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@emyller
emyller requested a review from a team as a code owner October 29, 2026 21:27
@emyller
emyller requested review from khvn26 and removed request for a team October 29, 2026 21:27
@linear-code

linear-code Bot commented Oct 29, 2026

Copy link
Copy Markdown

SDK-16

@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 8309cb8b-5c9d-45d0-bcda-94ae8c57375f
Commits

Reviewing files that changed from the base of the PR and between 6ff9115 and 867c9bb.

Files selected for processing: 8
  • .github/workflows/codspeed.yml
  • .gitmodules
  • Makefile
  • benchmarks/codspeed/codspeed.c
  • benchmarks/codspeed/extconf.rb
  • benchmarks/codspeed/instrument-hooks
  • benchmarks/run.rb
  • codspeed.yml

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

The change adds benchmark data and a Ruby harness with five benchmark operations. The harness measures each operation with CodSpeed when instrumentation is enabled, or uses local timing otherwise. A native extension provides the CodSpeed instrumentation interface. Makefile targets install the pinned CodSpeed installer, build the extension, and run benchmarks. A GitHub Actions workflow runs the benchmark target on pushes to main, pull requests, and manual dispatches. The gemspec excludes files under benchmarks/.

Priority: Pending latest changes

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: Moderate · up to cbb2a

Merge Risk: 🟡 Moderate · up to cbb2a

On systems where the installer’s executable directory is absent from PATH, benchmarks can fail or run a different CodSpeed version. Make the pinned executable available to the recipe before merging.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 0d8ea988-006a-4bbc-8b71-08427cc26ce3
Commits

Reviewing files that changed from the base of the PR and between 51544ab and aa70be9.

Files selected for processing: 8
  • .github/workflows/codspeed.yml
  • .gitmodules
  • Makefile
  • benchmarks/run.rb
  • benchmarks/sdk_benchmark.rb
  • codspeed.yml
  • flagsmith.gemspec
  • spec/sdk-benchmarks

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Comment thread benchmarks/sdk_benchmark.rb Resolved
emyller and others added 4 commits October 30, 2026 10:50
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…make

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 4bcc2769-bbad-4882-a56c-340b973caa87
Commits

Reviewing files that changed from the base of the PR and between eca3a1f and 6ff9115.

Files selected for processing: 2
  • .github/workflows/codspeed.yml
  • Makefile

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Comment thread .github/workflows/codspeed.yml Resolved
Comment thread Makefile Resolved
emyller and others added 2 commits October 30, 2026 13:42
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@codspeed

codspeed Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Congrats! CodSpeed is installed 🎉

🆕 15 new benchmarks were detected.

You will start to see performance impacts in the reports once the benchmarks are run from your default branch.

1 warning

⚠️ 1 benchmark is dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

Detected benchmarks


Open in CodSpeed

@khvn26 khvn26 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

bom dia

@khvn26
khvn26 merged commit a95445c into main Oct 30, 2026
10 checks passed
@emyller
emyller deleted the feat/codspeed branch October 30, 2026 17:54
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.

2 participants