Skip to content

Binder: per-property binding uses uncached reflection and allocates a path string on the happy path #151

Description

@Reefact

Review finding 15/19 · conventional-comment issue (perf) · area binder · gate: decide before the v1 API freeze
To add once they exist: labels binder, perf; milestone v1. (Already applied: enhancement.)

Problem

Each bound property resolves its value through uncached reflection (selector compilation / PropertyInfo.GetValue per call) and builds its argument-path string even when the element is valid. A review measurement put the happy path at roughly 2.2–2.4 µs and ~700 bytes allocated per property.

Impact

For a hot primary-adapter boundary (every incoming request), the per-property reflection and eager path allocation add up, and the cost is paid even when nothing fails.

Direction

Cache compiled getters per (type, property) and build the path string only when a failure is recorded. Re-measure against the current code first — the numbers predate the New/Create redesign shipped in #141.

Context

Surfaced by the RequestBinder review (design spec #126, shipped in #141). Finding 15 of 19.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions