perf(sync): scope remote save discovery by installed ROMs - #270
perf(sync): scope remote save discovery by installed ROMs#270brendannoble wants to merge 5 commits into
Conversation
Stream and locally filter device-scoped save records, preserve authoritative empty responses, and use bounded per-ROM fallback only after bulk errors. Add safety limits, diagnostics, and regression coverage.
|
RomM PR rommapp/romm#4304 addresses the server-side part of this performance problem by adding rom_ids scoping with a maximum of 500 IDs per request. I am updating this PR to consume that contract directly: one scoped request for up to 500 ROMs and sequential 500-ID batches for larger libraries, while retaining per-response safety limits and the existing bounded fallback for older or failing servers. This keeps the Grout change focused and avoids requiring the broader pagination proposal. |
|
RomM PR rommapp/romm#4304 has merged into master at |
What changed
rom_idsquery parameterrom_ids, discard the suspect response, and perform one independently validated broad requestrommapp/romm#4304 has merged and provides server-side
rom_idsfiltering. Older RomM versions remain correct through the compatibility behavior.Why
Remote save discovery previously made one request per uncovered ROM. RomM #4304 provides a bounded way to request saves for the ROMs a device actually has.
Request scaling on a supporting RomM server:
Nrequests to1Nrequests toceil(N / 500)N-request fallback, with at most four in flightDecoding remains linear in requested ROM IDs plus returned save records. Batches are sequential to keep server load and client memory predictable.
Safety and failure behavior
rom_idswhen an out-of-scope record shows that the server ignored the new parameterValidation
go test ./...go test -race ./romm ./syncgo vet ./...staticcheck; repository-wide output has only existing unrelated findingsgofmtandgit diff --checkamd64,arm64,386, andarm/v7Device validation
The save flow was tested on a ROCKNIX RG34XX-SP:
That device run exercised the legacy compatibility path because its RomM server did not include #4304. The now-merged wire contract is covered by Grout HTTP integration tests that send repeated
rom_idsvalues in 500-ID batches. RomM merge commitc3241a7passed its MariaDB and PostgreSQL endpoint suites, andgo test ./romm ./sync -count=1passes on this branch.