Skip to content

Release v1.1.0: LRU Cache implementation + Optimization

Latest

Choose a tag to compare

@Ts-Pytham Ts-Pytham released this 13 Feb 05:25

v1.1.0 - LRU Cache Implementation

πŸŽ‰ New Data Structure

LRUCache<TKey, TValue>

A high-performance Least Recently Used cache with fixed capacity and automatic eviction.

Features:

  • ⚑ O(1) operations: Put, Get, Remove, ContainsKey, TryAdd
  • πŸ”„ Automatic LRU eviction when capacity is reached
  • πŸ’Ύ Memory efficient (~190 bytes per item)
  • πŸ“¦ Generic implementation

Use Cases:

  • API response caching
  • Database query results
  • Session data storage
  • Computed results caching

πŸ“Š Performance Improvements

  • SortedList LowerBound optimization: 16-22% faster on typical workloads

πŸ“š Documentation

  • New comprehensive guide: docs/caches.md
  • Real-world examples (API cache, DB cache)
  • Performance characteristics and best practices

πŸ—ΊοΈ Roadmap

Added planned features:

  • AVL Tree (self-balancing BST)
  • Skip List
  • Indexed Priority Queue
  • Thread-safe variants

πŸ› Bug Fixes

  • Fixed LRUCache.Clear() state management
  • Fixed AddFirst() edge case
  • Corrected BST documentation

πŸ“ˆ Statistics

  • 39 new unit tests (all passing)
  • 7 new benchmarks
  • 1 new data structure
  • 3 bugs fixed

Full changelog: v1.0.0...v1.1.0