perf: cache the result of successful subcmd lookup