Use SyncLruCache instead of cached for in-memory cache #5714
Labels
C-housekeeping
Category: Refactoring, cleanups, code quality
T-contract-runtime
Team: issues relevant to the contract runtime team
In #5259, we've started to replace usages of
cached
crate withlru
, which has nicer, smaller API and is faster. We should use that to implement our global in-memory cache:nearcore/runtime/near-vm-runner/src/cache.rs
Lines 341 to 358 in 6a4cffa
Steps:
cached
macro with a hand-declaredstatic OnceCell<SynLruCache>
for both usages in the file feat:near-chain
Replacecached
withlru
#5871cached
from Cargo.toml feat:near-chain
Replacecached
withlru
#5871Result<Result<wasmer::Module, CompilationError>, CacheError>
, the inner error should be cached, but the outer error should be propagated feat: Don't cacheCacheError
insidecache.rs
#5907Clone
bound fromCacheError
io::Error
to theCacheError
The text was updated successfully, but these errors were encountered: