Awesome Reviewers

When code builds prompts, traverses trees, calls external APIs, or processes many items, make performance predictable by enforcing budgets, preventing pathological inputs, and removing redundant work.

Apply these rules: 1) Short-circuit expensive work at global caps

Example pattern:

# Assume MAX_ITEMS and items already collected
if len(items) >= MAX_ITEMS:
    return items  # do not build clients or call more APIs

for candidate in candidates:
    if len(items) >= MAX_ITEMS:
        break
    items.append(candidate)

2) Guard resource usage with hard limits

3) Reuse fetched data; avoid redundant API calls

4) Avoid repeated expensive lookups and unnecessary allocations

5) Prefer O(1) lookups with the right data structures

Net effect: fewer external calls, less parsing/IO, bounded memory, and deterministic latency under worst-case inputs.