Expand description
Internal performance optimizations for the native backend.
This module contains various in-memory optimizations that accelerate graph traversal without changing the on-disk format or public APIs. All optimizations are internal implementation details only.
§INLINE HINT STRATEGY (Phase 13 Step 5)
§Tier A: Tiny Hot Path Functions (#[inline(always)])
unlikely(): Simple boolean wrapper used frequently in hot pathsget_outgoing_edges(),get_incoming_edges(): Simple HashMap accessget(),put(): Simple cache operations- Thread-local access wrappers: Minimal overhead functions
§Tier B: Small Helper Functions (#[inline] or compiler-driven)
register_edge(): Moderate complexity but hot path- Cache management functions: Used frequently but larger logic
§Tier C: Large Functions (no inline hints)
- Cache eviction logic: Complex algorithms left to compiler discretion
Structs§
- Neighbor
Pointer Table - Neighbor pointer table mapping node IDs to lists of edge file offsets This enables O(1) adjacency lookup without scanning edge slots
- NodeHot
- Hot-field node cache containing frequently accessed node metadata This avoids full node deserialization for adjacency operations
- Node
HotCache
Functions§
- clear_
all_ caches - Clear all optimization caches (useful for testing)
- extract_
node_ hot - Extract hot metadata from a node record
- get_
incoming_ edge_ offsets - Get incoming edge offsets for a node from the pointer table
- get_
node_ hot - Get hot metadata for a node from the cache
- get_
outgoing_ edge_ offsets - Get outgoing edge offsets for a node from the pointer table
- put_
node_ hot - Put hot metadata for a node in the cache
- register_
edge_ offset - Register an edge in the neighbor pointer table This should be called whenever an edge is written to disk Optimized with cold-path offloading for cache management
- with_
neighbor_ pointer_ table - Get access to the global neighbor pointer table
- with_
node_ hot_ cache - Get access to the global node hot cache