perf: cache inspect.signature() at decoration time (#97) #107

Merged
cal merged 1 commits from ai/major-domo-v2-97 into next-release 2026-03-20 17:45:52 +00:00

1 Commits

Author SHA1 Message Date
Cal Corum
a3e63f730f perf: cache inspect.signature() at decoration time (#97)
Move inspect.signature(func) calls from inside wrapper functions to the
outer decorator function so the introspection cost is paid once at
decoration time instead of on every invocation.

- logged_command: sig, param_names, and exclude_set computed at decoration time;
  wrapper.__signature__ reuses the pre-computed sig
- cached_api_call: sig moved to decorator scope; bound_args still computed
  per-call (requires runtime args)
- cached_single_item: same as cached_api_call

Closes #97

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-20 17:45:06 +00:00