Feat: Add RocketMQ workload benchmarks#122
Conversation
|
Warning Review limit reached
More reviews will be available in 52 minutes and 54 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (25)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Pull request overview
This PR adds RocketMQ-style workload benchmarks (topic routing, message properties, and remoting header encode/parse) to evaluate CheetahString vs other string representations, and also introduces supporting infrastructure (layout snapshots/artifacts, benchmark scripts, CI artifact upload). In addition, it includes significant core API and behavior changes around byte/string construction, substring search implementation, and release automation.
Changes:
- Added RocketMQ workload benchmark suites (
mq_topic,mq_properties,mq_remoting_header) plus additional benchmark coverage (pattern,mutation,layout). - Refactored core string behavior: substring search moved to
memchr/memmem, byte conversions shifted toward validatedTryFrom, and introducedCheetahBytesbehind thebytesfeature. - Added artifact capture conventions + scripts, CI upload for layout artifacts, and a new release workflow.
Reviewed changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/search.rs | Adds search semantics tests for find/rfind and CheetahFinder. |
| tests/mutation.rs | Adds mutation tests validating in-place append/reserve behavior via pointer stability. |
| tests/layout_snapshot.rs | Emits a layout JSON snapshot into target/layout-artifacts during tests. |
| tests/bytes.rs | Adds CheetahBytes tests (feature-gated), including UTF-8 validation on conversion. |
| tests/basic.rs | Updates tests for new conversion semantics and buffer reuse expectations. |
| src/simd.rs | Silences dead-code warnings for now-unused SIMD search helpers. |
| src/serde.rs | Simplifies serde impl and adds UTF-8 validation for byte inputs. |
| src/search.rs | Introduces memchr/memmem-based byte search utilities and CheetahFinder. |
| src/lib.rs | Wires new modules/exports (search, CheetahFinder, CheetahBytes) and updates docs. |
| src/cheetah_string.rs | Major internal/storage and conversion API changes; search now uses crate::search. |
| src/bytes.rs | Adds CheetahBytes wrapper over bytes::Bytes with serde support (feature-gated). |
| scripts/bench-all.sh | Adds a bench runner script that saves outputs under bench-results/<version>/. |
| scripts/bench-all.ps1 | Adds a PowerShell bench runner script saving outputs under bench-results/<version>/. |
| README.md | Updates docs for v1.1.0, memchr search default, and CheetahBytes. |
| Cargo.toml | Bumps crate to 1.1.0, adds optional bytes, adds memchr, adds new benches/dev-deps. |
| benches/pattern.rs | Adds search/pathological benchmark coverage (finder vs find). |
| benches/mutation.rs | Adds mutation/reserve microbenchmarks. |
| benches/mq_topic.rs | Adds RocketMQ topic insert/lookup benchmarks across string types. |
| benches/mq_remoting_header.rs | Adds RocketMQ-like header encode/parse benchmarks across string types. |
| benches/mq_properties.rs | Adds RocketMQ properties build/lookup benchmarks across string types. |
| benches/layout.rs | Adds a bench-mode layout snapshot artifact generator. |
| benches/comprehensive.rs | Updates comprehensive bench to use try_from_vec for validated construction. |
| bench-results/README.md | Defines benchmark artifact layout conventions and capture commands. |
| .github/workflows/release.yml | Adds a tag/manual release workflow for fmt/clippy/tests/package/publish/release. |
| .github/workflows/ci.yaml | Expands CI to OS/Rust matrix, no_std checks, layout snapshot, artifact upload. |
Comments suppressed due to low confidence (1)
src/serde.rs:78
cheetah_stringregistersvisit_bytes/visit_byte_buf, but callsdeserialize_str, so Serde formats that encode bytes (e.g.serde_jsonbyte arrays, bincode, etc.) will never hit these visitors and will fail to deserialize. Usedeserialize_any(ordeserialize_bytesif you want bytes-first) so the visitor methods are actually reachable.
CheetahString::try_from_vec(v).map_err(Error::custom)
}
}
deserializer.deserialize_str(CheetahStringVisitor)
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| #!/usr/bin/env sh | ||
| set -eu |
| cargo test layout_snapshot --all-features -- --nocapture | | ||
| Tee-Object -FilePath (Join-Path $ResultDir "layout-test.txt") |
| cargo bench --bench layout | | ||
| Tee-Object -FilePath (Join-Path $ResultDir "layout-bench.txt") |
| cargo bench --bench comprehensive | | ||
| Tee-Object -FilePath (Join-Path $ResultDir "comprehensive.txt") |
| cargo bench --bench mutation | | ||
| Tee-Object -FilePath (Join-Path $ResultDir "mutation.txt") |
| cargo bench --bench mq_remoting_header | | ||
| Tee-Object -FilePath (Join-Path $ResultDir "mq-remoting-header.txt") |
| cargo bench --bench pattern | | ||
| Tee-Object -FilePath (Join-Path $ResultDir "pattern.txt") |
| cargo bench --bench simd --features simd | | ||
| Tee-Object -FilePath (Join-Path $ResultDir "simd.txt") |
| [package] | ||
| name = "cheetah-string" | ||
| version = "1.0.1" | ||
| version = "1.1.0" | ||
| authors = ["mxsm <mxsm@apache.org>"] |
| name: Release | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - "v*.*.*" | ||
| workflow_dispatch: | ||
| inputs: | ||
| version: | ||
| description: "Version to release, for example 1.1.0" | ||
| required: true | ||
| type: string | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
4756788 to
24d0fcd
Compare
Implements the RocketMQ workload benchmark stage.
Scope:
Verification completed locally:
cargo bench --bench mq_topic --no-runcargo bench --bench mq_properties --no-runcargo bench --bench mq_remoting_header --no-runCloses #114.