Skip to content

perf: cache deserialized sysvars in SysvarCache to reduce SVM latency#1108

Closed
raushan728 wants to merge 1 commit intojito-foundation:masterfrom
raushan728:perf/sysvar-cache-caching
Closed

perf: cache deserialized sysvars in SysvarCache to reduce SVM latency#1108
raushan728 wants to merge 1 commit intojito-foundation:masterfrom
raushan728:perf/sysvar-cache-caching

Conversation

@raushan728
Copy link

@raushan728 raushan728 commented Jan 3, 2026

Currently, SysvarCache re-deserializes sysvars on every access. This PR implements OnceLock<Arc<T>> caching for frequently used sysvars (Clock, Rent) to bypass bincode overhead in the execution hot-path.

Micro-benchmark results (1k sequential calls):

  • Baseline: 69µs
  • Optimized: 25µs (~63% speedup)
  • Environment: AMD Ryzen 3 2300U

Includes program-runtime/benches/sysvar_cache_bench.rs for verification.

@buffalu buffalu closed this Jan 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants