cache
full name: lasyten.cache
parent module:
lasytentype: module
Declared in lasyten/cache.py; the caches are implemented in C++
(include/lasyten/tools/lru_cache.h). Their sizes are set by the config options
su_n_symbol_cache_mb, tree_plan_cache_mb and tree_size_memo_mb (see lasyten.config).
The block data of open packed symbol files (su_n_packed_ram_mb) is held outside these budgets.
Functions
- lasyten.cache.cache_info() dict[str, dict[str, int]][source]
Statistics of all caches.
- Returns:
Keys
'symbols','tree_plans'and'tree_sizes'; each maps to a dict with the entrieshits,misses,evictions,rejected(insertions that were not cached),entries,bytes(estimated size of the stored entries) andcapacity_bytes. The key'packed_files'maps to the memory held by open SU(N) symbol files in the packed layout, which is not part of the symbol cache budget:files,index_bytesanddata_bytes_in_ram.- Return type:
- lasyten.cache.clear_caches() None[source]
Remove all entries from all caches (the hit/miss counters are kept).
This also releases the symmetries (and their open data files) that cached tree plans still held. It is registered to run at interpreter exit, so that the symmetries are destroyed while Python is still fully functional.