Releases: zigcc/zig-msgpack
0.0.16
Release 0.0.16
New Features
- PackerIO API: Added
PackerIOwrapper for convenient integration withstd.io.Readerandstd.io.Writerinterfaces - packIO() convenience function: Quick initialization helper for creating PackerIO instances
Testing
- Added comprehensive test suite with 30+ test cases for PackerIO functionality
Documentation
- Updated documentation with I/O usage examples and performance optimization details
- Updated CI badge references and platform support information
Note: PackerIO requires Zig 0.15 or later.
0.0.15
zig-msgpack 0.0.15 Release Notes
Overview
Performance-focused release with 5-90% speed improvements, enhanced security features, and Zig 0.16 support. Fully backward compatible with 0.0.14.
Performance Optimizations
CPU Cache Prefetching
- x86/x64: SSE/AVX prefetch instructions (
PREFETCHT0/1/2,PREFETCHNTA) - ARM64: ARM PRFM instructions for Apple Silicon and ARM servers
- 10-20% faster for large strings/binary, 8-15% faster for large arrays/maps
- Compile-time feature detection, zero runtime overhead
SIMD & Parser Optimizations
- SIMD-accelerated integer operations, string comparison, memory copying
- O(1) lookup table for marker byte conversion
- HashMap replaces ArrayList for map storage (10× faster lookups)
- Branch prediction hints for hot paths
Security Features
Iterative Parser with Configurable Limits
- Prevents stack overflow on deeply nested input
- Protection against DoS attacks (depth bombs, size bombs)
- Default limits: 1K depth, 1M elements, 100MB strings/binary
const StrictPacker = msgpack.PackWithLimits(
*Writer, *Reader,
Writer.Error, Reader.Error,
Writer.write, Reader.read,
.{
.max_depth = 50,
.max_array_length = 10_000,
.max_map_size = 10_000,
.max_string_length = 1024 * 1024,
.max_bin_length = 1024 * 1024,
.max_ext_length = 512 * 1024,
},
);Platform Support
- OS: Windows, macOS (Intel/ARM), Linux
- Architectures: x86_64, ARM64, RISC-V, MIPS
- Zig Versions: 0.14.0, 0.15.x, 0.16.0-dev
- 87 tests across all platform combinations
New Features
Timestamp API
const ts = Timestamp.fromNanos(1234567890123456789);Zig 0.16 Compatibility
- New
src/compat.zigcompatibility layer - Drop-in
BufferStreamreplacement for removedstd.io.FixedBufferStream - Same API across Zig 0.14-0.16
Performance Benchmarks (ReleaseFast)
| Operation | 0.0.14 | 0.0.15 | Improvement |
|---|---|---|---|
| Large strings (300B) | ~12 µs/op | ~10 µs/op | +20% |
| Large binary (1KB) | ~8 µs/op | ~6.7 µs/op | +16% |
| Medium arrays (100) | ~19 µs/op | ~16.7 µs/op | +12% |
| Medium maps (50) | ~520 µs/op | ~48 µs/op | +90% |
| Nested structures | ~17 µs/op | ~13 µs/op | +23% |
Bug Fixes
- Enhanced validation for malformed data
- Fixed integer boundary edge cases
- Improved security limit error messages
- Removed unused parameters
No Breaking Changes
None. Fully backward compatible with 0.0.14.
Migration
zig fetch --save https://github.com/zigcc/zig-msgpack/archive/v0.0.15.tar.gzChangelog
Features
- Multi-architecture CPU cache prefetch (x86/ARM)
- SIMD integer optimizations
- Configurable security limits (
PackWithLimitsAPI) Timestamp.fromNanos()method- Generic map keys with SIMD
- Cross-platform CI testing
Performance
- HashMap replaces ArrayList for maps
- Parser lookup table optimization
- Hot path branch prediction hints
- Optimized array initialization
Compatibility
- Zig 0.16 compatibility layer (
src/compat.zig) - CI matrix for Zig 0.14, 0.15, 0.16
Infrastructure
- Architecture matrix CI (x86_64, ARM64)
- Cross-platform testing (Windows, macOS, Linux)
- Automated benchmarking
0.0.14
Version 0.0.14
Key Changes
Security and Stability
- Converted recursive parser to iterative implementation with configurable safety limits to prevent stack overflow attacks
- Added ParseLimits struct with controls for
max_depth,max_array_length,max_map_size,max_string_length, andmax_ext_length - Introduced
PackWithLimits()function for custom limit configuration with backward-compatiblePack()wrapper - Refactored
Payload.free()to iterative stack-based implementation - Added new error types for limit violations (
MaxDepthExceeded,ArrayTooLarge,MapTooLarge,StringTooLong,ExtDataTooLong) - Comprehensive test suite for deep nesting, malicious payloads, and corrupted data
Performance
- Added complete performance benchmarking suite (
bench.zig) - Benchmarks cover all MessagePack operations in both debug and optimized builds
- Detailed throughput and latency metrics available
Documentation
- Updated README with security features and parsing limits
- Added security architecture section explaining iterative parsing and memory safety
- Documented PackWithLimits and ParseLimits API
- Fixed error naming from MsGPackError to MsgPackError for consistency
Breaking Changes
None. The new PackWithLimits() function is an addition, and Pack() maintains backward compatibility.
0.0.13
Release 0.0.13 (0.0.12 → 0.0.13)
📊 Statistics: 12 commits
✨ New Features
- Utilizing the inherent characteristics of zig to achieve some performance improvements
- Performance Benchmarking Suite: Added comprehensive benchmarking system (
bench.zig)- Covers serialization/deserialization performance for all major types
- Provides throughput and latency metrics
- Supports performance comparison for different container sizes
🧪 Testing Improvements
- Fuzz Testing: Added comprehensive fuzz testing suite for improved robustness
- Constant Validation: Added complete constant validation tests
🔧 Refactoring & Optimization
- Parsing Logic Optimization: Optimized extension type and timestamp parsing logic
- Integer Read/Write Simplification: Simplified integer read/write methods, reduced code duplication
- Type Conversion Enhancement: Improved Payload type conversion with enhanced type safety
- Constant Organization: Replaced magic numbers with named constants for better readability
- Error Naming Standardization: Unified error naming conventions
- Code Formatting Standardization: Standardized indentation and spacing style
📚 Documentation
- AGENT.md: Added comprehensive LLM code reading guidelines
👥 Contributors
- jinzhongjia (12 commits)
0.0.12
Release Notes: v0.0.12
🎉 Release Overview
Tag 0.0.12 has been successfully created and pushed to the remote repository!
📋 Version Information
- Version: 0.0.11 → 0.0.12
- Release Date: September 22, 2025
- Total Commits: 7
✨ New Features
Enhanced Zig 0.16 Compatibility Support
-
feat(zig-compat): Enhance cross-version support for Zig 0.16 (5e0c70e)
- Added compatibility layer for removed
std.io.FixedBufferStream - Exported compatibility module in main msgpack module
- Updated example code to use cross-version buffer stream implementation
- Modified test imports to use new compatibility layer
- Added compatibility layer for removed
-
feat(zig-compat): Add compatibility layer for multiple Zig versions (f942c1d)
- Introduced
compat.zigto handle standard library differences across Zig versions - Implemented cross-version BufferStream to replace FixedBufferStream
- Support for Zig 0.14.1, 0.15.1, and master versions
- Introduced
🔧 Improvements
Code Refactoring and Quality
- refactor(msgpack): Improve code readability and add comprehensive tests (0b417fc)
- Enhanced code structure and maintainability
- Extended test coverage
Documentation Updates
- docs(readme): Update Zig 0.16 compatibility status (fa65a5e)
- docs(readme): Update version compatibility and Zig 0.16 support notes (5b4eea8)
- Updated README.md and README_CN.md documentation (f9cf587, 8308c6d)
🚀 Key Improvements
- Cross-Version Compatibility: Library now works seamlessly across Zig 0.14.0, 0.15.x, and 0.16.0-dev
- API Stability: Maintains consistent API across versions through compatibility layer
- Better Documentation: Updated both English and Chinese documentation with clearer version compatibility information
📊 Statistics
- Commits: 7
- Contributors: 1 (jinzhongjia)
- Files Changed: README.md, README_CN.md, src/msgpack.zig, src/test.zig, src/compat.zig
💡 Upgrade Guide
Upgrading from v0.0.11 to v0.0.12 is safe with no breaking changes. If you're using Zig 0.16+, it's recommended to use the new compatibility layer API:
// Use compatibility layer for cross-version support
const compat = msgpack.compat;
var write_buffer = compat.fixedBufferStream(&buffer);
var read_buffer = compat.fixedBufferStream(&buffer);🔗 Links
0.0.11
Release Notes: 0.0.10 → 0.0.11
Changes (3 commits)
✨ New Features
- feat(zig-compat): add compatibility layer for multiple Zig versions (f942c1d)
📝 Other Changes
- Add Claude instruction file for the codebase (f61843d)
- chore(ci): add Zig 0.15.1 to CI matrix and version checks (0222e07)
👥 Contributors
- jinzhongjia (3 commits)
0.0.10
0.0.9
Summary
Added comprehensive MessagePack timestamp extension type (-1) support and significantly expanded test coverage for the zig-msgpack library.
Key Features
🕐 Timestamp Extension Support
- Support for all three MessagePack timestamp formats per specification:
- 32-bit timestamp: Seconds-only for 32-bit unsigned integers
- 64-bit timestamp: Nanosecond precision with 34-bit second range
- 96-bit timestamp: Full range with signed 64-bit seconds + 32-bit nanoseconds
- Automatic optimal format selection based on value ranges
- Seamless integration with existing serialization/deserialization logic
🧪 Comprehensive Testing Enhancement
- Boundary testing for all MessagePack formats (array32, map32, str16/32, bin16/32, ext8/16/32)
- Edge case coverage (NaN/infinity floats, int64/uint64 boundaries, error conditions)
- Format marker verification and Unicode string support
- Memory management validation and timestamp-specific tests
📚 Documentation Improvements
- Updated README.md with timestamp usage examples and API documentation
- Added Chinese translation (README_CN.md)
- Enhanced usage examples and error handling documentation
Technical Implementation
- Strict adherence to MessagePack timestamp specification (extension type ID -1)
- Nanosecond precision validation (0-999,999,999)
- Full Unix timestamp range support including pre-1970 negative values
- Maintains backward compatibility
Breaking Changes
None. Fully backward-compatible additive functionality.
Performance Impact
Minimal. Negligible timestamp support overhead with optimal storage efficiency through automatic format selection.
0.0.8
What's Changed
- docs: add getty-msgpack to related projects by @LordMZTE in #10
- fix: write array len after array16 && array32 header definitions by @Pix-xiP in #11
New Contributors
Full Changelog: 0.0.7...0.0.8
0.0.7
support zig 0.14.0
Full Changelog: 0.0.6...0.0.7