Skip to content

PERF: Reduce Allocations In Cache Key Builder #3

@MrEthical07

Description

@MrEthical07

Background:
Cache key generation happens on each cacheable read request and is currently string-heavy.

Problem:
internal/core/cache/manager.go key construction uses multiple allocations for canonical value assembly and hashing path, which is a hot cost under load.

Scope:

Tasks:

  • Refactor canonical key assembly to reduce temporary allocations.
  • Profile and optimize normalized dimension processing.
  • Add focused benchmark for BuildReadKey variants.
  • Validate no key drift for existing route and vary configurations.

Acceptance Criteria:

  • Lower allocs/op and ns/op on key generation benchmarks.
  • No cache key correctness regressions for existing configurations.
  • Existing cache safety rules remain intact.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions