Skip to content

docs: sender-key backlog Arc-COW perf (whatsapp-rust#881) - #342

Closed
jlucaso1 wants to merge 4 commits into
mainfrom
claude/eager-cerf-jalukb
Closed

jlucaso1 wants to merge 4 commits into
mainfrom
claude/eager-cerf-jalukb

Conversation

@jlucaso1

@jlucaso1 jlucaso1 commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Summary\n\nDocuments the performance improvement merged in oxidezap/whatsapp-rust#881.\n\n- Adds changelog/2026-06-16-sender-key-arc-backlog.mdx — explains the Arc-COW change to SenderKeyState.message_keys, the ~3× median speedup for in-order group decrypts with a populated backlog, and the benchmark numbers\n- Updates docs.json to register the new entry at the top of the changelog navigation\n\n## What changed in whatsapp-rust#881\n\nSenderKeyState now stores its skipped-message-key backlog in Arc<Vec<…>> rather than inside the protobuf struct. Cloning a sender-key record (which happens on every group decrypt via load_sender_key) is now a refcount bump instead of a deep copy of up to ~82 KB. Copy-on-write (Arc::make_mut) is used only when the backlog is actually mutated. No public API changes, no new dependencies.\n\n## Test plan\n\n- [ ] Changelog page renders correctly in Mintlify preview\n- [ ] New entry appears at the top of the Changelog tab\n- [ ] Benchmark table and numbers match the PR description"


Generated by Claude Code


Summary by cubic

Documented the sender-key backlog Arc + COW performance change from whatsapp-rust#881, with benchmarks showing ~3x faster in-order group decrypts. Added a new changelog page and put it first in docs.json; aligned sub-headings to ### and restored Rust Arc capitalization in the title.

Written for commit 4192d90. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Performance Improvements

    • Group message decryption is now ~3× faster for large backlogs.
    • Reduced memory allocation overhead during message processing.
  • Documentation

    • Updated changelog with performance optimization details.

@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

A new MDX changelog entry dated June 16, 2026 is added, documenting a SenderKeyState performance optimization where the skipped-message-key backlog is stored behind an Arc<Vec<SenderMessageKey>> instead of being deeply cloned from protobuf on each cache retrieval. The page is registered in the docs navigation.

Changes

Sender Key Arc Backlog Changelog

Layer / File(s) Summary
Changelog content and navigation registration
changelog/2026-06-16-sender-key-arc-backlog.mdx, docs.json
New MDX page describes the SenderKeyState Arc backlog change, prior cloning behavior (~82 KB per load_sender_key), the new serialization-only protobuf reassembly invariant, and benchmark results (~3× faster in-order decrypt). Page slug is added to the Changelog navigation list in docs.json.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

A rabbit hops through cached keys with glee,
No more deep clones — just one Arc shared free!
The backlog stays thin, protobuf sleeps at rest,
Three times faster decrypt, put latency to the test.
🐇✨ Less alloc, more speed — the warren agrees!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically summarizes the main change: documenting a performance optimization (Arc-COW) for sender-key backlog with a reference to the source PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/eager-cerf-jalukb

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.

@mintlify

mintlify Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
whatsapp-rust 🟢 Ready View Preview Jun 16, 2026, 12:57 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@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

🧹 Nitpick comments (1)
changelog/2026-06-16-sender-key-arc-backlog.mdx (1)

14-14: ⚡ Quick win

Use ### headings for section labels instead of bold text.

Per the learnings from the recent changelog PR, section labels like "What changed", "Benchmark results", and "No breaking changes" should use markdown ### headings, not bold text. The guidance is explicit: "use bold (**...**) only for individual named entry titles (e.g., **Bot message decryption (msmsg)**). Do not replace ## section headings with bold text."

♻️ Proposed refactor
-**What changed.** `SenderKeyState` now holds the backlog in a dedicated `Arc<Vec<SenderMessageKey>>` field.
+### What changed
+
+`SenderKeyState` now holds the backlog in a dedicated `Arc<Vec<SenderMessageKey>>` field.
-**Benchmark results** (`bench_group_in_order_decrypt_with_backlog`, ~2000-key backlog, same machine A/B):
+### Benchmark results
+
+(`bench_group_in_order_decrypt_with_backlog`, ~2000-key backlog, same machine A/B):
-**No breaking changes.** No public API surface changed. No new dependencies added.
+### No breaking changes
+
+No public API surface changed. No new dependencies added.

Also applies to: 20-20, 32-32

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@changelog/2026-06-16-sender-key-arc-backlog.mdx` at line 14, Replace the bold
text section label "**What changed.**" with a markdown heading "### What
changed" on line 14. Move the content that follows onto a new line after the
heading. Apply the same formatting change to any other section labels (like
"Benchmark results" and "No breaking changes") elsewhere in the file at lines
20-20 and 32-32, converting bold text formatting to `###` markdown headings
while preserving the section content.

Source: Learnings

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@changelog/2026-06-16-sender-key-arc-backlog.mdx`:
- Line 2: The page title in the file uses title case when it should use sentence
case per coding guidelines. In the title attribute on line 2, change the word
"Arc" to lowercase "arc" to comply with sentence case formatting for
documentation headings. The title should read "June 16, 2026 — Group decrypt:
sender-key backlog shared behind arc" instead of the current version with
capitalized "Arc".

---

Nitpick comments:
In `@changelog/2026-06-16-sender-key-arc-backlog.mdx`:
- Line 14: Replace the bold text section label "**What changed.**" with a
markdown heading "### What changed" on line 14. Move the content that follows
onto a new line after the heading. Apply the same formatting change to any other
section labels (like "Benchmark results" and "No breaking changes") elsewhere in
the file at lines 20-20 and 32-32, converting bold text formatting to `###`
markdown headings while preserving the section content.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e4f1df92-c94c-41c6-a578-464bc87c40a6

📥 Commits

Reviewing files that changed from the base of the PR and between 9232593 and d8441b6.

📒 Files selected for processing (2)
  • changelog/2026-06-16-sender-key-arc-backlog.mdx
  • docs.json

Comment thread changelog/2026-06-16-sender-key-arc-backlog.mdx

@cubic-dev-ai cubic-dev-ai 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.

No issues found across 2 files

Tip: cubic could auto-approve low-risk PRs like this, if it thinks it's safe to merge. Learn more

Re-trigger cubic

@cubic-dev-ai cubic-dev-ai 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.

1 issue found across 1 file (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Fix all with cubic | Re-trigger cubic

Comment thread changelog/2026-06-16-sender-key-arc-backlog.mdx Outdated
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.

1 participant