- **Updated:** merge commit `1ad052ed`, incorporating `origin/master` at `7ddb0121`.
- **Environment:** Release net10.0, .NET 10.0.13, Apple M4/macOS ARM64.
Both versions already contain pooled encoder workspaces, decoder model reuse,
stack scratch, direct metadata serialization and pooled LZMA2 compressed output.
This comparison measures the upstream merge, not the cumulative improvement over
the original unoptimized library.
**Outcome:** existing allocation savings are preserved. Async archive writing
allocates less, especially with large raw headers. Elapsed-time variation does
not establish a general throughput improvement or extraction regression.
## Measurement method
Libraries and harnesses are saved separately before measurement. No builds or
tests run concurrently with measured workloads. Inputs, caller buffers, metadata
objects and reflection delegates are prepared outside the measurement window.
- Allocations are exact `GC.GetTotalAllocatedBytes(true)` deltas, not heap sizes.
- Microbenchmarks use two warmups and five measured iterations; tables show medians.
- Extraction uses two warmups and three measured iterations per process.
- Writer timing repeats alternate version order across three process pairs,
giving 15 measured iterations per version after warmup.
- Large-header writing has one untimed validating write, then two warmups and
five measured writes. Archive parsing and header CRC checks are outside timing.
- EventPipe sampled-thread-time and allocation traces are collected separately
from untraced measurements. On macOS, thread-time samples include waits and
safepoints; allocation-tick weights are approximate type attribution.
These are controlled **warm-pool allocation measurements**, not guarantees of
allocation-free cold starts, lower retained capacity, or lower process RSS.
## Workloads
| Workload | Contents and measurement boundary |
| --- | --- |
| Archive extraction | Four 50 MiB files alternating seeded random and structured 64 KiB regions; 200 MiB total output, discarded through a preallocated 64 KiB buffer |
| Small-file writing | 16 independent 4 KiB random files; seekable MemoryStream output, including archive finalization |
| LZMA2 block writing | Three independently compressed 2 MiB blocks, structured or random; output discarded to `Stream.Null` |
| Large-header archive writing | 10,000 empty files with long/short Unicode names and partial times; complete async archive creation with raw or compressed headers |
The extraction archive uses solid LZMA2, an 8 MiB dictionary, one compression
thread, compression level 3 and compressed headers. It was generated with native
`7zz`; its compressed size is 106,462,260 bytes. Each extraction opens a new
archive over preloaded memory, drains all four entries and checks total output.
`LeaveStreamOpen = true` and `EnableParallelism = false` are explicit.
Raw entry-stream extraction **does not add high-level payload CRC validation**.
Checksum-validating extraction is tested separately; these timings must not be
compared as equivalent work to checksum-validating extraction in other formats.
Parallel decoding and a full codec/solidness/I/O/API matrix are outside this profile.