核心能力
Latency Tracking
Agent 每次工具调用的端到端延迟分解——schema 验证、沙箱设置、工具执行、结果序列化。每个环节的时间精确到毫秒,让平台团队快速定位性能热点。
Incremental Cost
增量计算 vs 全量重计算的实际成本对比。Agent 的 DirtySet 机制声称只重算被修改的区域——Performance 模块量化验证这一声明的实际收益,给 Agent 开发者提供真实的性价比数据。
Bottleneck Detection
自动识别流程中的性能瓶颈。统计 Agent 调用链中每个工具的平均耗时和方差,当某个工具的延迟显著高于基线时自动告警——让优化优先级一目了然。
Resource Accounting
CPU / 内存 / IO 的精细化计费。每个 Agent 会话消耗了多少计算资源都记录在案——既可以为成本优化提供依据,也可以为 Agent 之间的资源竞争提供公平调度参考。
Closed-loop Trace
从 Agent proposal 到硅结果的完整性能链路。一条流水线从问题识别开始,经过 proposal、evaluation、commit、到最终的硅验证——Performance 追踪每个步骤的耗时和资源消耗,形成完整的闭环画像。
性能追踪示例
from ieda import AgentClient from ieda.performance import Trace, LatencyBreakdown client = AgentClient(tracing=True) # Run a full agent session with tracing with Trace.session("timing_opt_v1") as trace: snap = client.call("iDB.snapshot", design=design) result = client.call("iSTA.analyze", snap=snap.id) proposal = client.call("iPL.optimize", timing=result) # Get latency breakdown breakdown = trace.breakdown() for name, lat in breakdown.items(): print(f"{name}: {lat.latency_ms}ms (cpu={lat.cpu_ms}ms, mem={lat.mem_mb}MB)") # Detect bottlenecks bottlenecks = trace.bottlenecks(threshold_pct=20) for b in bottlenecks: print(f"Bottleneck: {b.tool} at {b.pct:.1f}% of session time") # Incremental vs full cost comparison cost = trace.compare(FullRecompute=snap.id) print(f"Incremental: {cost.incremental_ms}ms vs Full: {cost.full_ms}ms") print(f"Speedup: {cost.speedup:.1f}x")
{
"tool": "perf.trace_session",
"arguments": {
"session_id": "timing_opt_v1",
"enabled": true
}
}
{
"tool": "perf.breakdown",
"arguments": {
"session_id": "timing_opt_v1"
}
}
// Response
{
"tools": [
{"name": "iDB.snapshot", "latency_ms": 12, "cpu_ms": 8, "mem_mb": 4},
{"name": "iSTA.analyze", "latency_ms": 234, "cpu_ms": 220, "mem_mb": 120},
{"name": "iPL.optimize", "latency_ms": 890, "cpu_ms": 870, "mem_mb": 340}
],
"bottlenecks": [{"tool": "iPL.optimize", "pct": 78.3}]
}
# Enable performance tracing perf::trace_session timing_opt_v1 -enable true # Run tools normally — traces automatically collected iDB::snapshot -label "before opt" iSTA::analyze -snap snap_7f3a iPL::optimize -timing [iSTA::result] # Get breakdown perf::breakdown timing_opt_v1 # Output: latency and resource breakdown per tool # Compare incremental vs full perf::compare -incremental snap_dirty -full snap_7f3a # Output: speedup ratio and cost breakdown