Expand description
SQLite-backed bytecode cache for scripts.
Stores compiled bytecode indexed by (canonical_path, mtime). On 2+ runs, skips lex/parse/compile entirely — just deserialize and eval into fusevm.
Cache location: ~/.cache/stryke/scripts.db
Invalidation: mtime mismatch → recompile, update cache.
Modules§
- constants_
pool_ codec - Serde codec for serializing Vec
in bytecode Chunk.
Structs§
- Cached
Script - Cached script bundle: AST + compiled bytecode.
- Script
Cache - SQLite-backed script cache.
Statics§
- CACHE
- Global cache instance (lazy-initialized, Mutex-protected for thread safety).
Functions§
- cache_
enabled - Check if SQLite cache is enabled (default: true, disable with
STRYKE_SQLITE_CACHE=0). - clear
- Clear global cache.
- default_
cache_ path - Default path for the script cache db.
- evict_
stale - Evict stale entries from global cache.
- file_
mtime - Get mtime from file metadata as (secs, nsecs).
- stats
- Get global cache stats.
- try_
load - Try to load a cached script by path. Returns None on miss.
- try_
save - Store a compiled script in the cache.