Repository navigation
perf(ingest): reuse compression buffers across imported files - #763
Merged
Merged
Conversation
Every file above the compression threshold previously created a new zstd encoder. The allocation profile showed encoder setup consuming most of the allocated memory in a bulk import. Adopt the Kit encoder-reuse fix so both local imports and HTTP uploads benefit without changing compression policy or per-file durability. Pin the exact reviewed commit until a tagged Kit release includes it. Generated with Codex Co-authored-by: Codex <noreply@openai.com>
roborev: Combined Review (
|
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.
Speeds up local imports and HTTP uploads by reusing compression buffers between files. Previously, each file above the compression threshold created a new zstd encoder. This pins the merged Kit commit from kenn-io/kit#146, pending a tagged release containing the fix.
Measured medians from three runs per case on Linux/amd64 with CGO SQLite:
All inputs were unique synthetic incompressible files in fresh vaults. Source generation and daemon startup were excluded. The CLI/HTTP binaries used the same Kit base with and without encoder reuse; the final dependency pin was also measured with
BenchmarkAddPaths. These are not M2 measurements.Encoder reuse retains buffers between writes. In one 2,048-file daemon run, peak resident memory rose from approximately 106 MiB to 122 MiB; garbage collection can discard idle pool entries. Compression settings, on-disk format, and per-file durable publication remain unchanged.
The existing
TestServerShutdownDrainsActiveBrowserUploadexceeds its one-second deadline at default test concurrency on this host with both main (Kit v0.29.0) and this branch. It passes 20 isolated runs and the complete API package with-parallel=8.