Skip to content

[Task][Performance] Reduce repeated circuit-breaker key construction and scans in Divide #7826

Closed

Description

@Aias00

Goal

Reduce repeated circuit-breaker key construction, list allocation and scanning in the HTTP divide request path, while preserving routing and breaker state-transition correctness.

Performance baseline/tracking: #7650. Reviewed revision: 04f7c2e8b7d282f14510157a9ab0bfaab538ecac (2.7.2-SNAPSHOT). These are confirmed source-level operations, not yet profiled bottlenecks. No fixed performance gain is claimed.

Current repeated work

The cost grows with candidates/request and traffic rate. For one upstream at low rate it may be too small to justify a more complicated implementation.

Scope and acceptance criteria

  • Profile a controlled upstream matrix with 1, 10, 100+ targets, mixed allowed/blocked candidates and all-blocked states. Record allocation/request, key-construction CPU, GC and p99 at equal successful throughput.
  • Evaluate safe key/identity reuse and a bounded per-request or update-time representation. Avoid an unbounded global memoization map.
  • Avoid rebuilding keys already computed for filtering when recording the selected target's outcome; avoid redundant scan/allocation only when selection semantics remain equivalent.
  • Preserve selector/target isolation, identity changes, explicit target selection, load-balancing weights, retries and success/error/cancellation accounting.
  • Cover concurrent half-open admission and configuration removal. [BUG] Built-in upstream circuit breaker does not enforce a single half-open probe #7760 already tracks half-open probe correctness; this optimization must not hide or worsen that issue and may need to follow its fix.
  • Retain only measurable improvements; publish baseline/after commands, configurations and profiles. Do not replace correctness checks with an unchecked single-upstream shortcut.

Related work

#6584 introduced baseline breaker behavior; #7760 owns half-open admission correctness. The upstream snapshot/copy optimization is a separate ownership/publication change; this task should be measured independently so the benefit and correctness of each change remain reviewable.

Activity

  1. added a commit that references this issue on Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions