You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/literate/howto/caching.jl
+4-1Lines changed: 4 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -68,4 +68,7 @@ reconstruct(algo, sinograms);
68
68
69
69
# Caches support serialization like other `RecoPlans`:
70
70
clear!(plan)
71
-
toTOML(stdout, plan)
71
+
toTOML(stdout, plan)
72
+
73
+
# Caches can also be resized. You can either set the maxsize property of the RecoPlan or use `resize!` on the `ProcessResultCache`. Resizing a cache affects all algorithms build from the same plan.
functionProcessResultCache(; param::Union{P, AbstractUtilityReconstructionParameters{P}}, maxsize::Int64=1, cache::LRU{UInt64, Any}=LRU{UInt64, Any}(maxsize = maxsize)) where P
13
+
if maxsize != cache.maxsize
14
+
@warn"Incosistent cache size detected. Found maxsize $maxsize and cache size $(cache.maxsize). This can happen when a cache is resized. Cache will use $(cache.maxsize)"
15
+
end
16
+
returnProcessResultCache(cache; param)
17
+
end
18
+
functionProcessResultCache(maxsize::Int64; param::Union{P, AbstractUtilityReconstructionParameters{P}}) where P
0 commit comments