Skip to content

Benchmark metadata and payload cache updates - #110

Merged
mjc merged 3 commits into
nntpp-34-transport-extension-rejectionfrom
nntpp-35-cache-metadata-payload-benchmark
Sep 11, 2026
Merged

Benchmark metadata and payload cache updates#110
mjc merged 3 commits into
nntpp-34-transport-extension-rejectionfrom
nntpp-35-cache-metadata-payload-benchmark

Conversation

@mjc

@mjc mjc commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • add a divan benchmark for hybrid cache update costs
  • separate metadata-only, retained-payload, and mixed update workloads

Branch-added tests

  • The benchmark defines isolated unique-key workloads for metadata-only, retained-payload, and mixed updates, with one-sample iterations and explicit hybrid-cache shutdown so the measured paths are comparable and bounded.

Copilot AI lite review requested due to automatic review settings September 5, 2026 21:48
@coderabbitai

coderabbitai Bot commented Sep 5, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Advanced

Run ID: d291a245-7c8a-4aff-8386-fe1295780cf0

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The benchmark’s timed region currently includes input construction (formatting/allocation), which undermines the stated goal of isolating cache update costs.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR adds a new Divan benchmark to quantify hybrid cache update costs, splitting the workload into metadata-only, retained-payload, and mixed update scenarios to make comparisons between update paths more explicit and bounded.

Changes:

  • Registers a new cache_metadata_payload benchmark target in Cargo.toml.
  • Adds benches/cache_metadata_payload.rs implementing three hybrid-cache update workloads (metadata-only, payload-only, mixed) with explicit cache shutdown.
File summaries
File Description
Cargo.toml Adds the new benchmark target so it can be executed via cargo bench --bench cache_metadata_payload.
benches/cache_metadata_payload.rs Implements the new Divan benchmark scenarios for hybrid cache metadata/payload update costs.
Review details

Suppressed comments (2)

benches/cache_metadata_payload.rs:76

  • The benchmark currently measures MessageId/response construction (formatting + allocation) along with the cache update. If the goal is update cost, move per-iteration input creation into with_inputs() and benchmark only upsert_ingest.
    bencher.bench(|| {
        let sequence = sequence.fetch_add(1, Ordering::Relaxed);
        runtime.block_on(cache.upsert_ingest(
            message_id(sequence),
            black_box(article_response(sequence)),

benches/cache_metadata_payload.rs:96

  • This mixed benchmark times key/response construction and atomic increments along with the cache updates. Using with_inputs() keeps the timed region focused on the cache operations so the result reflects metadata/payload update costs rather than formatting/allocation overhead.
    bencher.bench(|| {
        let sequence = sequence.fetch_add(2, Ordering::Relaxed);
        runtime.block_on(async {
            cache
                .record_backend_has_status(
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread benches/cache_metadata_payload.rs Outdated
@mjc
mjc force-pushed the nntpp-34-transport-extension-rejection branch from 3a3cc35 to 760b711 Compare September 5, 2026 23:28
@mjc
mjc force-pushed the nntpp-35-cache-metadata-payload-benchmark branch from db8708f to 0881e7f Compare September 5, 2026 23:28
@mjc
mjc merged commit 6a3df59 into nntpp-34-transport-extension-rejection Sep 11, 2026
8 checks passed
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