Crate runmat_snapshot

Crate runmat_snapshot 

Source
Expand description

§RunMat Snapshot Creator

High-performance snapshot system for preloading the RunMat standard library. Inspired by V8’s snapshot architecture, this provides:

  • Zero-copy serialization with memory mapping
  • Multi-tier compression with LZ4 and ZSTD
  • Integrity validation with SHA-256 checksums
  • Concurrent loading with lock-free data structures
  • Progressive enhancement with fallback mechanisms

§Architecture

┌─────────────────┐    ┌──────────────────┐    ┌─────────────────┐
│  Standard Lib   │ -> │   Snapshot       │ -> │   Runtime       │
│  Components     │    │   Generator      │    │   Loader        │
│                 │    │                  │    │                 │
│ • Builtins      │    │ • Serialization  │    │ • Memory Map    │
│ • HIR Cache     │    │ • Compression    │    │ • Validation    │
│ • Bytecode      │    │ • Validation     │    │ • Integration   │
│ • GC Presets    │    │ • Optimization   │    │ • Performance   │
└─────────────────┘    └──────────────────┘    └─────────────────┘

Re-exports§

pub use builder::SnapshotBuilder;
pub use format::SnapshotFormat;
pub use format::SnapshotHeader;
pub use format::SnapshotMetadata;
pub use loader::SnapshotLoader;

Modules§

builder
Snapshot builder for creating optimized snapshots of the standard library
compression
High-performance compression for snapshot data
format
Snapshot file format and serialization
loader
High-performance snapshot loader with memory mapping and caching
presets
Snapshot presets for common use cases
validation
Snapshot validation and integrity checking

Structs§

BuiltinMetadata
Metadata for a builtin function
BuiltinRegistry
Optimized builtin function registry for fast dispatch
BytecodeCache
Precompiled bytecode cache
BytecodeSequence
Bytecode sequence for common operations
ExecutionHint
Execution pattern hint
GcPerformanceProfile
GC performance profile
GcPresetCache
GC configuration presets
HirCache
Cached HIR representations
HirPattern
HIR pattern for common expressions
HotspotBytecode
Hotspot bytecode with JIT compilation hints
JitHint
JIT compilation hint
LoadingStats
Snapshot loading statistics
MemoryHint
Memory layout optimization hint
OptimizationHint
Optimization hint for hotspot bytecode
OptimizationHints
Runtime optimization hints
Snapshot
Core snapshot data containing preloaded standard library components
SnapshotConfig
Snapshot configuration
SnapshotManager
Main snapshot interface

Enums§

BuiltinArity
Function arity specification
BuiltinCategory
Builtin function categories for optimization
CacheEvictionPolicy
Cache eviction policies
CompressionAlgorithm
Compression algorithm options
ComputationalComplexity
Computational complexity for scheduling hints
ExecutionHintType
Types of execution hints
JitHintType
Types of JIT hints
MemoryHintType
Types of memory hints
OptimizationLevel
Optimization level for JIT compilation hints
PrefetchPattern
Memory prefetch patterns
SnapshotError
Error types for snapshot operations

Type Aliases§

SnapshotResult
Result type for snapshot operations