mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2498] [Issue]: storage_get scans collection files instead of using id lookups #1239
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#1239
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Promansis on GitHub (Jun 6, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2498
Originally assigned to: @Promansis on GitHub.
Summary
CrabNebula DevTools reports slow
storage_getcalls. Investigation on the refactor branch found thatstorage_gethas no id index for clean projected reads, so it can scan JSON collection rows until it finds the requested id. Plain gets can also scan when the full-row cache is cold.Code pointers from the current checkout:
src-tauri/crates/storage/src/lib.rs:1274clean projectedgetscans the JSON file until the id matches.src-tauri/crates/storage/src/lib.rs:1236plaingetalso scans if the full-row cache is cold.storage_getcalls.Expected behavior
Repeated
storage_getcalls by id should be close to constant time after storage is initialized, including projected gets. Hot collections should have an id lookup path or equivalent index/cache strategy that avoids repeatedly scanning collection JSON.Actual behavior
Projected clean gets bypass the clean full-row cache and scan the collection file for the requested id. Large collections or repeated get-heavy flows can therefore show slow
storage_getcalls in CrabNebula DevTools.Steps to reproduce
storage_getcalls taking a long time.Impact area
Environment
refactoratf9fc46b9v24.12.0, pnpm10.33.2rustc 1.95.0 (59807616e 2026-04-14)Logs, screenshots, or video
No screenshot attached. Local observation was CrabNebula DevTools showing slow
storage_getcalls.Focused storage tests were run during investigation and passed. The code path above is the suspected root cause.
Regression notes
Unknown whether this regressed from a previous storage implementation or became visible as collection sizes grew.
Additional context
This issue is separate from projected
storage_listcache validation hashing the full collection file. Both can contribute to slow storage timings, butstorage_getneeds an id-oriented lookup/index/cache path whilestorage_listneeds cheaper projected-cache validation.Template check
Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: