Open lstagner opened 1 year ago
If that can be done without a performance impact, then sure...
Note that you can already achieve the same thing on your side with:
use_memoize = true
struct OptionalMemoizer
memo
end
haskey(om::OptionalMemoizer, key) = use_memoize ? haskey(om.memo, key) : false
...
and then use @memoize OptionalMemoizer(Dict() function ...
Another tack would be to run this interactively:
@eval Memoize macro memoize(fdef)
esc(fdef)
end
Revise.revise(module_you_want_to_disable_memos)
I've been benchmarking some code and it would be nice to be able to turn off memoization. Something like
memoize!(false)
which sets a global switch.