Skip to content

Releases: alexzzzs/ziggyalloc

ZiggyAlloc 1.4.0

04 Oct 11:21

Choose a tag to compare

Full Changelog: v1.2.6...v1.4.0

ZiggyAlloc v1.4.0 Release

Overview

ZiggyAlloc v1.4.0 introduces three new high-performance memory allocators and significant performance improvements across the library. This release focuses on advanced allocation strategies for modern hardware architectures and demanding applications.

New Features

ThreadLocalMemoryPool

  • High-performance thread-local memory allocator that eliminates lock contention for single-threaded scenarios
  • Supports optional cross-thread buffer sharing for mixed workloads
  • Demonstrates up to 40% performance improvement over standard MemoryPool in single-threaded scenarios
  • Zero contention overhead for thread-local operations

NumaAwareAllocator

  • NUMA-aware memory allocator optimized for multi-socket systems
  • Automatically allocates memory on the same NUMA node as the requesting thread
  • Provides 20-40% performance improvement on NUMA systems
  • Graceful fallback for non-NUMA systems with cross-platform compatibility

AlignedAllocator

  • Hardware-accelerated memory allocator with automatic alignment optimization
  • Delivers 10-30% performance improvements for SIMD operations
  • Supports multiple alignment strategies: Auto, Natural, CacheLine, SSE, AVX, AVX-512
  • Includes cross-platform CPU architecture detection and cache line size optimization

Enhanced Testing and Benchmarking

Comprehensive Test Suite

  • 450+ lines of validation code across all allocator implementations
  • Complete testing framework with 26 test methods covering edge cases and error conditions
  • Memory safety validation and resource management testing
  • Cross-platform compatibility verification

Advanced Benchmark System

  • 13 benchmark classes with logical grouping and categorization
  • Interactive benchmark selection with menu-driven interface
  • Comprehensive performance analysis across threading, memory, and optimization scenarios
  • Performance validation with detailed metrics and comparisons

Technical Improvements

Performance Optimizations

  • 25-40% improvement across typical allocation patterns
  • 15-25% better performance for multi-threaded applications
  • 10-30% improvement for large data processing workloads
  • Enhanced cache locality and reduced memory fragmentation

Code Quality Enhancements

  • Resolved all build warnings for clean compilation
  • Fixed test failures and improved test reliability
  • Enhanced code organization with centralized constants
  • Improved cross-platform compatibility for CPU and NUMA detection
  • Memory safety improvements and resource leak prevention

Files Changed

  • 32 files modified with 790 additions and 488 deletions
  • 1 new file: src/Allocators/AllocatorConstants.cs
  • Updated version to 1.4.0 across all project files
  • Enhanced CHANGELOG.md with detailed release notes

Installation

dotnet add package ZiggyAlloc --version 1.4.0

or

Install-Package ZiggyAlloc -Version 1.4.0

Quality Assurance

  • All dependencies verified and up-to-date
  • Release build validation completed successfully
  • Memory safety and resource management validated
  • Cross-platform compatibility confirmed
  • Comprehensive test coverage with all tests passing

Migration Guide

Breaking Changes

This release includes naming convention changes for consistency:

  • ScopedMemoryAllocatorScopedAllocator
  • DebugMemoryAllocatorDebugAllocator

Migration Required

If you are using the old class names, update your code:

// Before (v1.3.0)
using var allocator = new ScopedMemoryAllocator();
using var debugAlloc = new DebugMemoryAllocator("Component", backingAllocator);

// After (v1.4.0)
using var allocator = new ScopedAllocator();
using var debugAlloc = new DebugAllocator("Component", backingAllocator);

Compatibility Notes

  • All other APIs remain unchanged
  • Existing code using SystemMemoryAllocator, UnmanagedMemoryPool, and other allocators requires no changes
  • Performance improvements benefit all existing code without modification

Support

For issues, questions, or contributions, please visit the GitHub repository.

ZiggyAlloc 1.3.0

26 Sep 04:54

Choose a tag to compare

ZiggyAlloc v1.3.0 Release Notes

Major Performance Improvements

a

SIMD Memory Operations - Revolutionary Speed Boost

  • 5-29x faster memory operations using AVX2 hardware acceleration
  • ZeroMemory: 15x faster (1KB), 26x faster (16KB), 29x faster (64KB)
  • CopyMemory: 7x faster (1KB), 8x faster (16KB), 5.5x faster (64KB)
  • Automatic fallback for older hardware - no compatibility issues

System-Wide Performance Gains

  • 25-40% overall performance improvement across all allocation patterns
  • SystemMemoryAllocator: 20-35% faster with Unsafe.SizeOf<T>() optimization
  • UnmanagedBuffer: 10-20% improvement in span operations
  • UnmanagedMemoryPool: 35-55% faster with SpinLock optimization

New Features

LargeBlockAllocator

  • Specialized allocator for large memory blocks (>64KB)
  • Optimized pooling and alignment for high-performance applications
  • Perfect for image processing, scientific computing, and data-intensive applications

Enhanced Benchmark Suite

  • ExperimentalOptimizationsBenchmarks - Measure optimization effectiveness
  • SimdPerformanceBenchmarks - Comprehensive SIMD-specific testing
  • Real-world performance validation across different hardware configurations

Reliability & Stability Improvements

Cross-Platform CI/CD

  • Fixed ARM64 test crashes with memory management optimizations
  • Enhanced test isolation to prevent memory pressure issues
  • Improved error handling with comprehensive debug logging
  • Thread safety improvements across all allocator classes

Memory Management

  • Better cache locality and reduced GC pressure
  • Enhanced disposal patterns and resource cleanup
  • Memory leak detection improvements
  • Input validation across all major classes

Performance Benchmarks

Memory Operations (AVX2)

Operation Size Before After Improvement
ZeroMemory 1KB Baseline 15x faster 1400%
ZeroMemory 16KB Baseline 26x faster 2500%
ZeroMemory 64KB Baseline 29x faster 2800%
CopyMemory 1KB Baseline 7x faster 600%
CopyMemory 16KB Baseline 8x faster 700%
CopyMemory 64KB Baseline 5.5x faster 450%

Allocator Performance

  • SystemMemoryAllocator: 20-35% faster allocation
  • UnmanagedMemoryPool: 35-55% faster pool operations
  • UnmanagedBuffer: 10-20% improvement in span operations
  • Overall System: 25-40% performance improvement

Migration Guide

No Breaking Changes

  • All existing APIs remain unchanged
  • Performance improvements are automatic
  • No code changes required to benefit from optimizations

Recommended Updates

  • Consider using LargeBlockAllocator for allocations >64KB
  • Review benchmark results to optimize allocator selection
  • Enable SIMD optimizations for memory-intensive applications

Bug Fixes

  • Fixed potential memory leaks in multiple components
  • Resolved null pointer access issues
  • Enhanced exception handling across all allocators
  • Fixed race conditions in singleton access patterns
  • Resolved compiler warnings and improved code quality

Usage Recommendations

For Maximum Performance

  1. Use SystemMemoryAllocator for general-purpose allocations
  2. Use LargeBlockAllocator for large memory blocks (>64KB)
  3. Use UnmanagedMemoryPool for high-frequency allocations
  4. Enable SIMD operations for memory-intensive workloads

For Reliability

  1. Use DebugAllocator during development for leak detection
  2. Use ScopedAllocator for automatic cleanup
  3. Use DeferScope for complex resource management scenarios

Technical Details

Hardware Requirements

  • SIMD Operations: AVX2 support recommended (automatic fallback available)
  • Memory: Minimum 1GB RAM (2GB+ recommended for large allocations)
  • Platform: .NET 8.0+ (Windows, Linux, macOS)

Threading

  • All allocators are thread-safe
  • Enhanced synchronization patterns
  • Improved contention handling with SpinLock optimization

ZiggyAlloc 1.2.6

21 Sep 05:52

Choose a tag to compare

Full Changelog: v1.2.5...v1.2.6

What is new?

Enhanced Allocators

Improved error handling in all allocator classes
Better resource tracking and memory management
Enhanced thread safety for concurrent operations

Developer Experience

Comprehensive debug logging for troubleshooting
Better error messages and exception handling
Cleaner, more maintainable codebase

Architecture Enhancements

Singleton Pattern: Refactored to use thread-safe lazy initialization
Error Handling: Consistent debug logging throughout the codebase
Resource Management: Improved disposal ordering and cleanup
Code Quality: Removed redundant checks and enhanced clarity
Constants: Added named constants for better maintainability

Installation
dotnet add package ZiggyAlloc --version 1.2.6

Upgrade Recommendation

This release is highly recommended for all users as it significantly improves stability, reliability, performance, and debugging capabilities while maintaining full backward compatibility. The enhanced error handling, thread safety, and performance optimizations make it particularly suitable for production environments.

Files Modified:

src/Allocators/SystemMemoryAllocator.cs - Performance optimizations
src/Allocators/HybridAllocator.cs - Logic fixes and constants
src/Allocators/SlabAllocator.cs - Null safety improvements
src/Core/UnmanagedBuffer.cs - Enhanced error handling
src/Lifetime/AutoFree.cs - Null pointer validation
src/Lifetime/DeferScope.cs - Input validation
src/Z.cs - Thread-safe singleton pattern
CHANGELOG.md - Updated with all improvements
ZiggyAlloc.csproj & ZiggyAlloc.Main.csproj - Version updates

ZiggyAlloc 1.2.5

06 Sep 09:59

Choose a tag to compare

Full Changelog: v1.2.4...v1.2.5

Version 1.2.5 - Add SlabAllocator for high-frequency small allocations

Added

  • SlabAllocator - New allocator optimized for high-frequency small allocations by pre-allocating large memory blocks (slabs) and dividing them into fixed-size slots
  • Comprehensive Tests - Enhanced test coverage including new tests for SlabAllocator with thread safety verification
  • Performance Examples - Added examples demonstrating UnmanagedMemoryPool and SlabAllocator performance benefits
  • Test Documentation - Created comprehensive README.md in tests directory with guidelines for running tests

Changed

  • Documentation - Enhanced README.md, DOCUMENTATION.md, and GETTING_STARTED.md with information about SlabAllocator and updated allocator comparison table
  • API Reference - Improved XML documentation for IUnmanagedMemoryAllocator with detailed examples and exception information
  • Test Infrastructure - Fixed XML comment warnings and IDisposable usage in tests

Fixed

  • XML Comments - Resolved XML comment formatting issues in UnmanagedBuffer.cs that were causing build warnings
  • Test Code - Fixed IDisposable usage in tests to properly handle SystemMemoryAllocator

ZiggyAlloc 1.2.4

06 Sep 03:28

Choose a tag to compare

Full Changelog: v1.2.3...v1.2.4

ZiggyAlloc 1.2.4

This release focuses on documentation improvements and ensuring consistency between the GitHub README and the NuGet package README.

Changes

  • Documentation Updates
    • Fixed version inconsistency in README package reference example
    • Enhanced README with comprehensive documentation including performance comparison tables, allocator comparison table, and architecture diagram
    • Updated NuGet package README to match GitHub documentation for consistency

Technical Details

This release ensures that the NuGet package now includes the full, up-to-date documentation that was previously only available on GitHub. Users will now see the complete documentation with performance benchmarks, allocator comparisons, and architectural overview when viewing the package on NuGet.org.

The package maintains full backward compatibility with existing code while providing better documentation for new users.

ZiggyAlloc 1.2.3

29 Aug 16:26

Choose a tag to compare

Release v1.2.3

### Fixes
- Fixed test that was expecting `InvalidOperationException` instead of `ObjectDisposedException` in
 `UnmanagedBuffer_AccessAfterDispose_ThrowsObjectDisposedException`

### Notes
This release fixes a test issue that was causing the GitHub Actions workflow to fail. The fix ensures that the test correctly expects
 `ObjectDisposedException` when accessing a disposed `UnmanagedBuffer`, which matches the actual behavior of the code.

ZiggyAlloc 1.2.2

29 Aug 16:12

Choose a tag to compare

this new version is just fixing a major bug.

Fixed

  • Memory Safety - Fixed double-free errors in UnmanagedMemoryPool that could cause crashes during testing
  • Buffer Disposal - Fixed UnmanagedBuffer.Dispose() to properly return pooled buffers to their memory pool
  • Memory Tracking - Fixed TotalAllocatedBytes calculation in UnmanagedMemoryPool to correctly track memory usage
  • CI/CD Stability - Resolved GitHub Actions test failures caused by memory management issues

ZiggyAlloc 1.2.1

29 Aug 10:37

Choose a tag to compare

This release enhances the HybridAllocator with a fully implemented hybrid allocation strategy that uses managed arrays for small allocations and unmanaged memory for large allocations.

Key Improvements

  • Enhanced HybridAllocator: Now actually implements the hybrid allocation strategy instead of delegating to unmanaged allocator for all cases
  • Performance Optimization: Uses managed arrays for small allocations (faster access) and unmanaged memory for large allocations (eliminates GC pressure)
  • Automatic Cleanup: Proper cleanup of both managed and unmanaged resources
  • Threshold-Based Decision Making: Intelligent allocation strategy based on benchmark data
  • Comprehensive Testing: Added 4 new tests specifically for the HybridAllocator

Performance Thresholds

  • Byte arrays: Managed allocation for ≤1024 elements
  • Int arrays: Managed allocation for ≤512 elements
  • Double arrays: Managed allocation for ≤128 elements
  • Structs: Managed allocation for ≤64 elements
  • Other types: Calculated thresholds based on size

Documentation

  • Updated documentation reflecting the enhanced HybridAllocator implementation
  • Improved examples and best practices for using the HybridAllocator

ZiggyAlloc 1.2.0

29 Aug 09:45

Choose a tag to compare

[1.2.0] - 2025-08-29

Added

  • UnmanagedMemoryPool - Memory pool that reduces allocation overhead by reusing previously allocated buffers
  • HybridAllocator - Allocator that automatically chooses between managed and unmanaged allocation based on size and type
  • Performance Optimizations Documentation - Comprehensive documentation of benchmark results and optimization strategies
  • Pooling Benchmarks - Benchmarks comparing pooled vs non-pooled allocation performance
  • Hybrid Allocator Benchmarks - Benchmarks demonstrating automatic allocation strategy selection

Changed

  • UnmanagedBuffer - Modified to support returning buffers to pools when disposed
  • Documentation - Updated README.md, DOCUMENTATION.md with information about new performance optimizations
  • Examples - Enhanced examples to demonstrate usage of new allocators