Expand description
File index for efficient log navigation (Option 3 Implementation)
This module provides a lightweight index structure that scans the file once to identify log boundaries and metadata without full parsing.
§How it works:
- Fast Initial Scan: On file open, scan all lines to find log boundaries
- Extract Metadata: For each log, extract timestamp and layer (cheap operation)
- Build Index: Store line ranges and metadata for each log
- Lazy Parsing: Parse full log content only when needed (on navigation)
- Smart Caching: Cache parsed logs to avoid re-parsing
§Benefits:
- Fast file loading (~0.5s for 10k logs)
- Know total log count immediately
- Efficient layer filtering (no need to parse disabled layers)
- Instant navigation (index knows where each log is)
Structs§
- File
Index - Index structure for efficient file navigation
- LogMetadata
- Metadata for a single log entry