← Workflows

阅读中文版本

Performance Impact Review Workflow

Assess the performance impact of a change covering query counts, algorithmic complexity, and payload size.

advanced~50 minreviewperformancequality

Objective

Catch performance regressions during review before they reach production.

Environment

  • Profiling or query logging
  • Complexity knowledge
  • A benchmark for hot paths

Steps

1. Check query and call counts

Look for new per-item queries or calls that scale with data size.

Expected state: No accidental N+1 or chatty patterns are introduced.

2. Check algorithmic complexity

Look for nested loops or repeated scans on large inputs.

Expected state: Complexity is appropriate for the input size.

3. Check payload and allocation

Review changes that inflate response size or allocate heavily.

Expected state: Payloads and allocations stay reasonable.

4. Measure hot paths

Benchmark or profile when the change touches a known hot path.

Expected state: Evidence confirms no regression on hot paths.

Decision points

Benchmark every change?

  • Benchmark hot paths only
  • Benchmark everything

Benchmark and profile only changes touching known hot paths.

Trust intuition or measure?

  • Measure when in doubt
  • Trust intuition

Measure on hot paths; intuition is unreliable at scale.

Expected outcome

Performance regressions are caught in review rather than discovered in production.

Verification

Confirm no new per-item queries appear and hot-path benchmarks show no regression.

Cleanup

Add a regression test or budget for any hot path the change touches.

Overview

Catch performance regressions during review before they reach production.

This workflow is reusable across teams and environments; adapt the commands to your tooling while keeping the sequence and checkpoints intact.

Environment and prerequisites

  • Profiling or query logging
  • Complexity knowledge
  • A benchmark for hot paths

Procedure

1. Check query and call counts

Look for new per-item queries or calls that scale with data size.

Expected state: No accidental N+1 or chatty patterns are introduced.

2. Check algorithmic complexity

Look for nested loops or repeated scans on large inputs.

Expected state: Complexity is appropriate for the input size.

3. Check payload and allocation

Review changes that inflate response size or allocate heavily.

Expected state: Payloads and allocations stay reasonable.

4. Measure hot paths

Benchmark or profile when the change touches a known hot path.

Expected state: Evidence confirms no regression on hot paths.

# count queries issued by a request in tests
assert queryLog.length === 3

Verification

Confirm no new per-item queries appear and hot-path benchmarks show no regression.

Decision points

Benchmark every change?

  • Benchmark hot paths only
  • Benchmark everything

Recommendation: Benchmark and profile only changes touching known hot paths.

Trust intuition or measure?

  • Measure when in doubt
  • Trust intuition

Recommendation: Measure on hot paths; intuition is unreliable at scale.

Common failures

  • New per-item queries scale badly.
  • Nested loops on large inputs cause regressions.
  • Payload growth hurts client performance.