You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR integrates CodSpeed for continuous performance monitoring of ext-php-rs core operations.
What's included
Criterion benchmarks using the CodSpeed compatibility layer (codspeed-criterion-compat), added as a new [[bench]] target in the main crate with the embed feature.
CodSpeed GitHub Actions workflow (.github/workflows/codspeed.yml) that runs on pushes to master, pull requests, and manual dispatch. It uses OIDC authentication and simulation mode for reproducible measurements.
CodSpeed badge added to the README.
Benchmark coverage
The benchmarks test performance-sensitive paths across the FFI boundary:
The CodSpeed benchmark setup for ext-php-rs exhausted all 3 retry attempts due to Rust compilation errors in the benchmark file. The benchmarks use Embed::run() which requires FnOnce() -> R + UnwindSafe, but capturing &mut Criterion in the closure violates this bound. The correct fix (wrapping the entire closure with AssertUnwindSafe instead of just the reference) was implemented locally but could not be pushed because the retry limit was reached. The fix commit (04d289a82) changes Embed::run(|| { c.bench_function(...) }) to Embed::run(AssertUnwindSafe(|| { c.bench_function(...) })) for all 12 benchmark functions. This is a straightforward code fix that would resolve the build on the next attempt.
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
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.
Summary
This PR integrates CodSpeed for continuous performance monitoring of ext-php-rs core operations.
What's included
codspeed-criterion-compat), added as a new[[bench]]target in the main crate with theembedfeature..github/workflows/codspeed.yml) that runs on pushes tomaster, pull requests, and manual dispatch. It uses OIDC authentication and simulation mode for reproducible measurements.Benchmark coverage
The benchmarks test performance-sensitive paths across the FFI boundary:
All benchmarks use
Embed::run()to start an embedded PHP SAPI, testing the actual runtime behavior of the library rather than synthetic stubs.CI workflow details
The workflow mirrors the existing benchmark CI setup for PHP and LLVM/Clang dependencies:
libphp-embedfor the embed featurecargo-codspeedfor building and running benchmarks in simulation modeNext steps
master, CodSpeed will start reporting performance diffs on subsequent pull requests.