Skip to content

perf(tools): cache extracted string values in ToolCallDag to avoid double scan #1714

@bug-ops

Description

@bug-ops

Context

ToolCallDag::build() extracts leaf string values from each call's input JSON. The dependency check in native.rs (~line 633) calls extract_string_values() again per-tool in the tier dispatch loop. For n≤10 calls this is negligible, but it is a DRY violation.

Fix

Cache the extracted string vec alongside each node in ToolCallDag, expose it via a method, and remove the redundant call in native.rs.

Identified by: performance agent during PR #1712 review (PERF-02)

Metadata

Metadata

Assignees

No one assigned

    Labels

    performancePerformance improvements

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions