Download Latest Version v0.2.4 source code.tar.gz (1.7 MB)
Email in envelope

Get an email when there's a new version of Stoolap

Home / v0.2.3
Name Modified Size InfoDownloads / Week
Parent folder
README.md 2026-01-17 2.3 kB
v0.2.3 source code.tar.gz 2026-01-17 1.6 MB
v0.2.3 source code.zip 2026-01-17 2.0 MB
Totals: 3 Items   3.6 MB 0

What's New in v0.2.3

SmartString - Custom SSO String

  • Inline storage for strings ≤22 bytes (no heap allocation)
  • Owned (Box<str>) for computed values, Shared (Arc<str>) for cloned values
  • 24-byte size with O(1) clone for shared variant

I64Map - High-Performance Hashmap for i64 Keys

  • Uses i64::MIN as empty sentinel (row/txn IDs are always ≥0)
  • FxHash-based with linear probing and backward-shift deletion
  • ~45% faster lookups than FxHashMap<i64, V>

Value Interning

  • Interned: NULL (all 7 DataTypes), booleans, integers 0-1000
  • Reduces allocations for frequently used values in rows

Aggregation Fixes & Optimizations

  • Fixed hash collision bug in single-column GROUP BY (was using hash as key)
  • Added 2-column tuple optimization (30% faster than Vec<Value>)
  • Single-column primitive GROUP BY uses I64Map directly

SIMD Pattern Matching

  • memchr::memmem for LIKE '%pattern%' substring search
  • Pre-compiled Finder stored in CompiledPattern

O(1) COUNT(*) and COUNT(DISTINCT) Fast Paths

  • Committed row count atomic counter for O(1) COUNT(*)
  • get_distinct_count_excluding_null() in Index trait for O(1) COUNT(DISTINCT)
  • Compiled query cache for COUNT queries with schema epoch validation
  • Performance: COUNT(*) ~22.5µs → ~2.9µs (7.7x faster)

Background Cleanup and Memory Management

  • Background cleanup thread for periodic garbage collection
  • Configurable via CleanupConfig (interval, retention periods)
  • Arena slot reuse to prevent unbounded memory growth
  • Memory at program end: 665 KB → 153.6 KB (77% reduction)

Global Pool and Cache Cleanup

  • clear_version_map_pools() for TransactionVersions pools
  • clear_program_cache() for expression bytecode LRU cache
  • clear_classification_cache() for query classification LRU cache

Other Improvements

  • CompactVec: new insert(), retain(), drain() methods
  • All indexes migrated to I64Map and CompactVec
  • Index trait _into methods to avoid allocations
  • RowIdVec pooled vector for index lookups (256K max cached capacity)
  • BTree index optimization using Borrow trait for lookups
  • Thorough SAFETY documentation on unsafe code

Full Changelog: https://github.com/stoolap/stoolap/compare/v0.2.2...v0.2.3

Source: README.md, updated 2026-01-17