Repository navigation
perf: Index requested cells for queued runs - #12244
Merged
Merged
Conversation
Reading each cell in an accepted run repeatedly scanned the same requested-cell list until the kernel supplied a plan. Cache membership by list identity so updates that reuse the list share the index.
Contributor
|
All contributors have signed the CLA ✍️ ✅ |
Contributor
|
React Doctor found no new issues. 🎉 Reviewed by React Doctor for commit |
kirangadhave
marked this pull request as ready for review
December 2, 2026 19:01
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The benchmark covers only warmed-cache reads, leaving cold accepted runs and overlapping runs with planned, disabled, or blocked cells without recorded human validation.
1 open issue
What changed in this PR
Speeds up queued-cell checks by caching requested-cell membership indexes across reads and run snapshots that share the same list.
Changes:
- Adds a lazy, weakly cached membership index.
- Tests index reuse and isolation between distinct lists.
- Adds warmed-cache benchmarks for 500 and 2,000 cells.
| File | Description |
|---|---|
| frontend/src/core/executions/select.ts | Replaces repeated list scans with cached set lookups. |
| frontend/src/core/executions/__tests__/select.test.ts | Tests cache reuse and separate-list behavior. |
| frontend/benchmarks/queued-run.bench.ts | Measures repeated queued-cell selector reads. |
Review effort: Balanced
Comment on lines
+35
to
+39
| await bench("read every cell view", () => { | ||
| for (const id of ids) { | ||
| cellExecutionView(inputs, id); | ||
| } | ||
| }).run({ time: 500, warmupTime: 200, iterations: 100 }); |
Contributor
Coverage Report for ./frontend
File Coverage
|
||||||||||||||||||||||||||||||||||||||
mscolnick
approved these changes
Dec 2, 2026
Contributor
|
🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.26.1-dev104 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This pull request was authored by a coding agent.
📝 Summary
Index the requested cell IDs when a queue check first needs them. Reuse the index across cell reads that share the same list. A weak cache ties the index to the lifetime of that list. Queue checks still account for planned executions, disabled and blocked cells, and overlapping runs.
Addresses the requested-cell membership part of MO-8797.
Each sample reads every cell view for one accepted run before the kernel plans any executions. The table shows the median of three p50 measurements per revision on an Apple M4 Pro with Node 26.13.0. The benchmark measures repeated selector reads after warmup. Index construction, browser rendering, and kernel time are outside the timed region.
📋 Pre-Review Checklist
✅ Merge Checklist