Skip to content

Reduce TAR entry buffer allocations - #40

Merged
andrew merged 2 commits into
mainfrom
perf/tar-entry-allocations
Sep 13, 2026
Merged

andrew merged 2 commits into
mainfrom
perf/tar-entry-allocations

Conversation

@andrew

@andrew andrew commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

TAR entry reads repeatedly grow their buffers even when the entry size is available. Preallocate for entries between 513 bytes and 64 KiB, bounded by the remaining decompression budget, while preserving read errors and size limits.

The existing BenchmarkOpenBytesTarGz fixture uses about 49% fewer allocated bytes and 44% fewer allocations. Add browsing benchmarks across entry sizes and regression coverage for extraction, prefixes, duplicate paths, truncated payloads, checksum errors, and decompression limits, plus a payload round-trip fuzz test.

@andrew
andrew merged commit 078da64 into main Sep 13, 2026
4 checks passed
@andrew
andrew deleted the perf/tar-entry-allocations branch September 13, 2026 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant