Skip to content

Stop contending for the shared rayon pool when summing entry sizes - #854

Open
CleanCut wants to merge 1 commit into
mainfrom
cleancut/entries-size-serial-sum
Open

Stop contending for the shared rayon pool when summing entry sizes#854
CleanCut wants to merge 1 commit into
mainfrom
cleancut/entries-size-serial-sum

Conversation

@CleanCut

Copy link
Copy Markdown
Contributor

We don't need to send entries to individual threads in a thread pool in order to read their num_bytes field. 🤣

ENG-1250

`compute_entries_size` summed a single `u64` field across a slice via `into_par_iter`. Summing
`u64`s is memory-bandwidth-trivial, so the split and work-steal overhead can never pay for itself,
and the call occupies liboxen's process-global rayon pool while it does. That pool is shared with
work that genuinely parallelizes — merkle-tree unpack in `fs_merkle_node_store::write_nodes` and
per-repo storage sizing in `namespaces` — so an unjustified `par_iter` here is pure contention for
those workers.

This was the only CPU-bound rayon call site in liboxen; the remaining three parallelize filesystem
latency, where overlapping I/O waits is the point.

ENG-1250
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 5c166a28-31af-4e5f-9c1a-97628962ef64

📥 Commits

Reviewing files that changed from the base of the PR and between ebab2cc and 2c66092.

📒 Files selected for processing (1)
  • crates/liboxen/src/repositories/entries.rs

📝 Walkthrough

Summary by CodeRabbit

  • Performance
    • Updated entry size calculation to use a streamlined sequential approach.
  • Maintenance
    • Removed an internal parallel-processing dependency from this calculation.

Walkthrough

The entry size calculation in entries.rs now uses sequential iteration. The Rayon prelude import was removed. The calculated total remains the sum of all entry byte sizes.

Changes

Entry size calculation

Layer / File(s) Summary
Sequential entry size summation
crates/liboxen/src/repositories/entries.rs
Removed the Rayon import. Changed compute_entries_size from into_par_iter to iter while preserving the summed byte-size result.

Estimated code review effort: 1 (Trivial) | ~2 minutes

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: avoiding contention on the shared Rayon pool during entry-size summation.
Description check ✅ Passed The description explains why serial summation is sufficient and identifies the related tracking issue.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cleancut/entries-size-serial-sum

Comment @coderabbitai help to get the list of available commands.

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