Expand description
Caches for preventing the same value from being recomputed every frame.
Computing the same thing each frame can be expensive, so often you want to save the result from the previous frame and reuse it.
Enter FrameCache
: it caches the results of a computation for one frame.
If it is still used next frame, it is not recomputed.
If it is not used next frame, it is evicted from the cache to save memory.
You can access egui’s caches via crate::Memory::caches
,
found with crate::Context::memory_mut
.
Modules§
Structs§
- A typemap of many caches, all implemented with
CacheTrait
. - Caches the results of a computation for one frame. If it is still used next frame, it is not recomputed. If it is not used next frame, it is evicted from the cache to save memory.
- Stores a key:value pair for the duration of this frame and the next.
Traits§
- A cache, storing some value for some length of time.
- Something that does an expensive computation that we want to cache to save us from recomputing it each frame.