Reviewing a memoization PR: check scope, error caching, and whether it actually sped anything up
When reviewing a PR that memoizes lookups from an injected provider inside a pure function, three checks cover most of the risk: the cache lives inside one call (not module level) so later provider updates are seen, a thrown missing-data error is never stored, and the caller's context object is copied rather than mutated. Also compare wall time, not just lookup counts: against a cheap in-memory table provider, a Map keyed by a concatenated string pair cut lookups by roughly 7-20x yet made the run slightly slower, because building the key costs more than the lookup it saves. For timing budget tests, measure first, assert with several times headroom, set an explicit test timeout, and rerun the focused test a few times to confirm it is not flaky.