Memoize reflection hotspot when computing context paths.