Skip to content

svga v0.1.4

Latest

Choose a tag to compare

@WendellXY WendellXY released this 12 Oct 04:33

This patch reduces temporary encoding allocations and accelerates common typed-decoding records. Public APIs, encoded bytes, format coverage, validation rules, default memory policy, and dependencies are unchanged.

  • Write canonical tags, lengths, and payloads into one final field buffer instead of allocating and concatenating temporary buffers.
  • Decode exact fixed32 layout/transform records directly, preserving float bits and previous components. Reordered, repeated, unknown, and malformed records retain the general decoder path.
  • Add boundary tests for varint widths, negative integers, special float bit patterns, repeated fields, and malformed records.
  • Exclude local investigation files from the published crate.

Measured process CPU changes versus 0.1.3 on a fixed 175-file production SVGA corpus on macOS ARM64 with Rust 1.97.1 during the optimization study (paired baseline/candidate sweeps):

Operation CPU time change
Typed decoding from retained documents −20.2%
Full parse, basic info, and destruction −2.9%
Typed encoding with embedded images −28.1%
Typed encoding plus fast zlib compression −18.6%

The frame-heavy encoding case made 59.7% fewer allocation/reallocation calls. Parsing requested-heap measurements were unchanged on the two profiled assets. These are local workload measurements, not playback FPS, device-energy results, or an app-equivalent Rust/Zig comparison.

Validation includes all-feature and no-default-feature tests and Clippy, Rust 1.89 MSRV checks/tests, WASM builds, iOS compilation, and byte-identical round-trip checks over all 175 production files. The crate remains pure Rust by default; no additional SIMD dependency or experimental allocator/inflater policy is included.

Full changelog: v0.1.3...v0.1.4