Expand description
Schema caching. Schema caching for JSON to HEDL conversion
When converting large JSON arrays to matrix lists, we often encounter the same structure repeatedly. Caching the inferred schema significantly improves performance by avoiding redundant key iteration and sorting.
§Performance Impact
- First schema inference: ~O(n*log(n)) where n is number of keys
- Cached lookup: ~O(1) hash map lookup
- Expected speedup: 30-50% for documents with repeated array structures
§Thread Safety
The cache is thread-safe using interior mutability with RwLock. Multiple threads
can read from the cache concurrently, while writes are exclusive.
Structs§
- Cache
Statistics - Statistics for cache performance monitoring
- Schema
Cache - Thread-safe LRU schema cache
- Schema
Cache Key - Cache key for schema lookup