Repository navigation
Keep the context's counts until a row is written - #257
Merged
Merged
Conversation
On a case of 150,000 rows in one folder source, one /api/context took 589 to 627 ms: folder_status read every row of the source (298 ms) and seven counts over files took 18 to 82 ms each. The gallery asks for the context on load, after imports and every fifteenth tick of a running job, and reads on the shared connection waited behind it (p95 101 ms). CaseDB.derived keeps an answer worked out from the case's rows until the connection's total_changes moves, the number the list view's count cache already uses. The context's counts and the folder facts are kept that way. The folder and the sample of files are still looked for on disk on every call. folder_status also reads only the paths. A context with nothing written since the last now takes 1.0 to 1.5 ms and reads no row of files; after a write it takes 464 to 489 ms. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Keeps the context's counts until a row is written to the case.
CaseDB.derivedholds an answer worked out from the rows until the connection'stotal_changesmoves./api/contextwent from about 600 ms to about 1 ms, and after a write to about 480 ms.Co-Authored-By: Claude Opus 5.5 [email protected]