Repository navigation
Conversation
dan-petty
force-pushed
the
perf/6614-encode-only-changed-records-and-scan-once-per-repo
branch
from
November 21, 2026 17:54
00db3ae to
a504d96
Compare
Plan the change that makes a save of the shared listing snapshot compress only the records that it sends, makes the loads of one repository in a process share one scan, and makes the load budget cover the wait, the inflate and the validation.
The tests fail on the base: ValkeySnapshotStore has no compress field, and a save compresses all records before it decides older or unchanged.
A save decides older from the schema key and the watermark before it encodes a record. A store that knows the stored records compares each record with the known record of its number, and encodes only the records that are not equal. It compresses only the records that it sends, through the new field compress. Only a write to a temporary key encodes and compresses all records.
ClockFake gets after_each_reading, a test action after each read of the monotonic clock. The test fails on the base: the second lane sends its own HSCAN while the first lane scans.
…6614) A load that misses the known records takes a lock for its repository before it scans. A load that waited reads the known records again and takes the records of the scan of the other load. A load with known records takes no lock.
The tests fail on the base and on the head of the lock for each repository: a load that passes its budget in its last HSCAN keeps the shared copy, and a lane that waits past its budget takes the records of the other lane.
The budget of a shared load starts when the load misses the known records. The store checks it after the lock, after each HSCAN step but the last, after each inflated record and after each validated record. A stop logs the step and counts the existing budget series.
…#6614) The module and class docstrings, the comment of the load budget and the intake document say that two lanes that load one repository at the same time share one scan, that the budget covers the wait, the inflate and the validation, and that a save compresses only the records that it sends.
…alidation budget and a lost delta (#6614) A shared copy whose field name is not the number of its record is a miss, and the next save raises no error. A save of the process during a scan keeps the records that it wrote, so the next save is a delta. A load that passes its budget in the validation gives no snapshot. A delta that loses its transaction writes every record to a temporary key.
…er number (#6614) A load kept its records as the known records even when a save of the process kept newer records during the scan, so the next save of the process wrote every record again. A load now keeps its records only when the known records are still the ones that it missed. A shared copy whose field name was not the issue number of its record passed the load, and each later save of the process raised KeyError. Such a record now makes the copy a miss, as a record that does not parse does.
dan-petty
force-pushed
the
perf/6614-encode-only-changed-records-and-scan-once-per-repo
branch
from
November 21, 2026 18:25
a504d96 to
8f3dd4d
Compare
dan-petty
marked this pull request as ready for review
November 21, 2026 18:42
dan-petty
deleted the
perf/6614-encode-only-changed-records-and-scan-once-per-repo
branch
November 21, 2026 18:46
Owner
Author
|
Check after the release: passed (v0.188.3, Service pod on the new image from 2026-11-21T18:58:38Z). Read only, Prometheus, rate over 30 minutes for each pod:
|
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.
A save of the shared listing snapshot encoded, hashed and compressed all records before it found that the save was older or unchanged: about 1.2 s for each unchanged save of devops-cli. A store now compares the records with the records that it last wrote or loaded, and compresses only the records that it sends. An older or unchanged save compresses no record.
Two lanes of one process that loaded one repository at the same time each sent a full HSCAN. A load now takes a lock for its repository, and a lane that waited takes the records of that scan. The load budget also covers the wait, the inflate and the validation. A record under a field that is not its issue number makes the copy a miss.
Local snapshot (6,653 records, fakeredis), main to head: median unchanged save 1.20 s to 0.03 s; peak memory of one load 101 MB to 102 MB, of two loads at once 192 MB to 102 MB.
Closes #6614
Change:
openspec/changes/archive/2026-11-21-6614-encode-only-changed-records-and-scan-once-per-repo/