Skip to content

Feat: Add RocketMQ workload benchmarks#122

Merged
mxsm merged 8 commits into
mainfrom
codex/pr-009-mq-workload-benchmarks
Jun 20, 2026
Merged

Feat: Add RocketMQ workload benchmarks#122
mxsm merged 8 commits into
mainfrom
codex/pr-009-mq-workload-benchmarks

Conversation

@mxsm

@mxsm mxsm commented Jun 20, 2026

Copy link
Copy Markdown
Owner

Implements the RocketMQ workload benchmark stage.

Scope:

  • Adds topic route lookup benchmarks.
  • Adds message properties benchmarks.
  • Adds remoting header parse/encode benchmarks.
  • Compares String, Arc, CompactString, SmartString, and CheetahString where applicable.

Verification completed locally:

  • cargo bench --bench mq_topic --no-run
  • cargo bench --bench mq_properties --no-run
  • cargo bench --bench mq_remoting_header --no-run
  • final full verification matrix on integration branch

Closes #114.

Copilot AI review requested due to automatic review settings June 20, 2026 02:23
@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@mxsm, we couldn't start this review because you've reached your PR review rate limit.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 85f40e91-726f-43b8-a980-25a938f43b8e

📥 Commits

Reviewing files that changed from the base of the PR and between 21aa0bf and 24d0fcd.

📒 Files selected for processing (25)
  • .github/workflows/ci.yaml
  • .github/workflows/release.yml
  • Cargo.toml
  • README.md
  • bench-results/README.md
  • benches/comprehensive.rs
  • benches/layout.rs
  • benches/mq_properties.rs
  • benches/mq_remoting_header.rs
  • benches/mq_topic.rs
  • benches/mutation.rs
  • benches/pattern.rs
  • scripts/bench-all.ps1
  • scripts/bench-all.sh
  • src/bytes.rs
  • src/cheetah_string.rs
  • src/lib.rs
  • src/search.rs
  • src/serde.rs
  • src/simd.rs
  • tests/basic.rs
  • tests/bytes.rs
  • tests/layout_snapshot.rs
  • tests/mutation.rs
  • tests/search.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/pr-009-mq-workload-benchmarks

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 and usage tips.

Copilot AI 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.

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 validated TryFrom, and introduced CheetahBytes behind the bytes feature.
  • 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_string registers visit_bytes / visit_byte_buf, but calls deserialize_str, so Serde formats that encode bytes (e.g. serde_json byte arrays, bincode, etc.) will never hit these visitors and will fail to deserialize. Use deserialize_any (or deserialize_bytes if 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.

Comment thread scripts/bench-all.sh
Comment on lines +1 to +2
#!/usr/bin/env sh
set -eu
Comment thread scripts/bench-all.ps1
Comment on lines +6 to +7
cargo test layout_snapshot --all-features -- --nocapture |
Tee-Object -FilePath (Join-Path $ResultDir "layout-test.txt")
Comment thread scripts/bench-all.ps1
Comment on lines +9 to +10
cargo bench --bench layout |
Tee-Object -FilePath (Join-Path $ResultDir "layout-bench.txt")
Comment thread scripts/bench-all.ps1
Comment on lines +12 to +13
cargo bench --bench comprehensive |
Tee-Object -FilePath (Join-Path $ResultDir "comprehensive.txt")
Comment thread scripts/bench-all.ps1
Comment on lines +15 to +16
cargo bench --bench mutation |
Tee-Object -FilePath (Join-Path $ResultDir "mutation.txt")
Comment thread scripts/bench-all.ps1
Comment on lines +24 to +25
cargo bench --bench mq_remoting_header |
Tee-Object -FilePath (Join-Path $ResultDir "mq-remoting-header.txt")
Comment thread scripts/bench-all.ps1
Comment on lines +27 to +28
cargo bench --bench pattern |
Tee-Object -FilePath (Join-Path $ResultDir "pattern.txt")
Comment thread scripts/bench-all.ps1
Comment on lines +30 to +31
cargo bench --bench simd --features simd |
Tee-Object -FilePath (Join-Path $ResultDir "simd.txt")
Comment thread Cargo.toml
Comment on lines 1 to 4
[package]
name = "cheetah-string"
version = "1.0.1"
version = "1.1.0"
authors = ["mxsm <mxsm@apache.org>"]
Comment on lines +1 to +16
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

@mxsm mxsm force-pushed the codex/pr-009-mq-workload-benchmarks branch from 4756788 to 24d0fcd Compare June 20, 2026 02:29
@mxsm mxsm merged commit 0691b27 into main Jun 20, 2026
7 checks passed
@mxsm mxsm deleted the codex/pr-009-mq-workload-benchmarks branch June 20, 2026 08:40
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.

Feat: Add RocketMQ workload benchmarks

2 participants