免费获取学习方案
ARTICLE DETAIL

资讯详情

深耕编程基础知识与建站技术分享的一线实战洞察。

Performance Review

Performance Review Performance Review【免费下载链接】oh-my-codexOmX - Oh My codeX: Your codex is not alone. Add hooks, agent teams, HUDs, and so much more.项目地址: https://gitcode.com/GitHub_Trending/oh/oh-my-codexSummaryOverall: [FAST / ACCEPTABLE / NEEDS OPTIMIZATION / SLOW]Critical Hotspotsfile.ts:42- [HIGH] - O(n^2) nested loop over user list - Impact: 100ms at n100, 10s at n1000Optimization Opportunitiesfile.ts:108- [current approach] - [recommended approach] - Expected improvement: [estimate]Profiling RecommendationsBenchmark: [specific operation]Tool: [profiling tool]Metric: [what to track]Acceptable Performance[Areas where current performance is fine and should not be optimized]模板的五个小节各有明确用途 - **Summary**用一个枚举值FAST / ACCEPTABLE / NEEDS OPTIMIZATION / SLOW给整体性能定调让读者一眼获得结论。 - **Critical Hotspots**列出最高优先级的热点每条包含 file:line、严重度标记、问题描述和可量化的影响如 n100 时 100ms、n1000 时 10s 的增长曲线。 - **Optimization Opportunities**以现状 - 建议方案 - 预期提升的形式给出优化建议且预期提升必须带估算值。 - **Profiling Recommendations**在动手优化前给出具体的基准测试操作、profiling 工具与待追踪指标落实先测再优化原则。 - **Acceptable Performance**明确列出当前性能已经够好、**不应**优化的区域防止过度优化。 ## OmX 源码中的角色定义与落地 performance-reviewer 不只是 prompt 文件它在 OmX 的 Agent 定义体系中是一个完整的可注册角色。在 [src/agents/definitions.ts](https://link.gitcode.com/i/45c3200f117cae2cb8046d75c9ca9e29) 中可以看到它的完整元数据 ts performance-reviewer: { name: performance-reviewer, description: Hotspots, complexity, memory/latency optimization, reasoningEffort: medium, posture: frontier-orchestrator, modelClass: standard, routingRole: leader, tools: read-only, category: review, },这些字段的实际含义字段类型见同一文件的 AgentDefinition 接口reasoningEffort: medium——审查类角色的中等推理强度与 quality-reviewer、api-reviewer 一致。posture: frontier-orchestrator——前线编排姿态优先做意图分类、在存在专家角色时默认委派与编排。该姿态的具体行为覆盖overlay定义在 src/agents/native-config.ts。modelClass: standard——适配标准能力模型对应 overlay 提示以明确验证与窄范围控制优先于投机性推理见 native-config.ts。routingRole: leader——在路由中扮演领导者角色。tools: read-only——只读工具模式性能审查不修改代码只输出审查结论。category: review——归属审查类别与 style-reviewer、code-reviewer 同组。该定义还配有一条硬性约束performance-reviewer定义中没有nativeSubagentDelegation: allowed因此在生成原生 Agent 时会被追加叶子节点守护NATIVE_SUBAGENT_LEAF_GUARD禁止其再派生子 Agent超出能力范围时须向上级 leader 报告见 src/agents/native-config.ts。OmX 的 prompts/performance-reviewer.md 正是这份角色 prompt 的源头。该文件带有 YAML frontmatterdescription与argument-hint生成原生 Agent 配置时会被剥离stripFrontmatter实现于 src/agents/native-config.ts随后与姿态 overlay、模型类别 overlay、Agent 元数据一起被组装成最终指令composeRoleInstructions见 src/agents/native-config.ts。根据 docs/prompt-migration-changelog.md该 prompt 曾经历 XML-like 包装块到 Markdown 章节结构的迁移且迁移时无功能性差异。如何在 OmX 中使用 performance-reviewer在 OmX 的标准工作流中审查通道的角色可通过描述直接调用。官方文档示例见 docs/agents.htmlperformance-reviewer profile hotspots从源码结构看performance-reviewer的 prompt 会随omx setup流程以prompts/name.md形式安装为 Codex 原生 Agent TOML写入~/.codex/agents/或./.codex/agents/其安装逻辑在 src/agents/native-config.ts 的installNativeAgentConfigs中实现遍历目录清单、读取 prompt 文件、组合指令并写出performance-reviewer.toml。生成的原生 Agent TOML 形如由 generateStandaloneAgentToml 生成# oh-my-codex agent: performance-reviewer name performance-reviewer description Hotspots, complexity, memory/latency optimization model resolved model model_reasoning_effort medium developer_instructions 组装后的角色指令 【免费下载链接】oh-my-codexOmX - Oh My codeX: Your codex is not alone. Add hooks, agent teams, HUDs, and so much more.项目地址: https://gitcode.com/GitHub_Trending/oh/oh-my-codex创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考
返回列表