You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 4326eb3
Browse filesBrowse the repository at this point in the historyBrowse files
perf: an idle client stops reopening the vault per key and retrying failed chat copies (#1980)
* test(vaultsync): a restore opens the vault a fixed number of times
Fails on dev: a restore of N shared keys opens the whole sealed vault
N+1 times, once per key the ledger knows.
* perf(vaultsync): read a scope's tombstones once per restore
A restore asked the vault whether each key the ledger knew had been
removed, and every question opened the whole sealed vault. A profile with
963 shared memories and a 1.5 MB vault decoded about 1.4 GB of JSON per
state round, every few seconds, in an idle terminal. Removed lists a
scope's tombstones in one read.
* refactor(olderchats): one visit per chat behind a copy seam
No behaviour change: the eligibility checks and the copy move into
olderChats.visit so a test can count copy attempts.
* test(olderchats): a failed copy waits for the chat to change
Fails on dev: the background copier tries a chat whose copy failed again
every round, and each attempt seals the chat's whole folder.
* perf(olderchats): a failed copy waits for its chat to change
The background copier visits every older chat each pass, and a copy seals
the chat's whole folder. A copy that failed was attempted again on every
pass for as long as the terminal stayed open. It is now remembered against
the journal's size and time, and tried again when the chat changes, on the
next launch, or when the person opens it.
* test(olderchats): the background copier leaves a folder that holds codeaf's home
Fails on dev: a chat started in a home directory is sealed whole in the
background, and that seal never settles while codeaf writes its own state
inside the folder.
* perf(olderchats): leave a folder that holds codeaf's home to be copied on open
A chat started in a home directory has codeaf's own state inside its
folder. Codeaf writes there while it runs, so the whole-folder seal a copy
begins with never settles: in a live terminal each attempt planned the
folder eight times and failed with "files kept changing". The background
copier now skips these chats; opening one still copies it.
* revert(olderchats): leave home-folder chats to the cellstore rule
#1976 makes a folder that holds the home folder seal only the chat's own
folder, which is the case this skip covered. One rule for it is enough;
the failed-copy memo stays.
* docs(changes): an idle terminal stops reopening the vault per key
title: An idle terminal no longer reopens the key vault once per shared key
4
+
pr: 1980
5
+
surface: [chat]
6
+
invalidates:
7
+
- "A home-state restore asked the vault about each shared key in turn and opened the whole sealed vault for every answer. It now reads the scope's removals once per restore."
8
+
- "The background copier tried an older chat whose copy failed again on every pass. A failed copy now waits until the chat changes, the next launch, or the person opening it."
9
+
---
10
+
With 963 shared memories and a 1.5 MB vault, a restore decoded about 1.4 GB of
11
+
JSON. A terminal that pulled every round sat above one core while nobody typed.
12
+
Measured on Spark against a copy of that profile, with the vault moving every
13
+
round, the client went from 111 to 115% CPU down to 15%. Without that, it went
0 commit comments