algorithm-complexity-analysis

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Algorithm Complexity Analysis

Algorithm复杂度分析

Overview

概述

Use this skill to quantify whether candidate approaches can meet performance and resource constraints at expected scale.
使用本技能量化候选方案能否在预期规模下满足性能和资源约束。

Scope Boundaries

范围边界

  • Use this skill when the task matches the trigger condition described in
    description
    .
  • Do not use this skill when the primary task falls outside this skill's domain.
  • 当任务符合
    description
    中描述的触发条件时,使用本技能。
  • 当主要任务超出本技能的领域范围时,请勿使用本技能。

Inputs To Gather

需要收集的输入

  • Candidate algorithms and dominant operations.
  • Input-scale assumptions (current, expected, and stress ranges).
  • Resource budgets (latency targets, throughput targets, memory limits).
  • Runtime context (I/O patterns, cache behavior, concurrency contention).
  • 候选Algorithm及核心操作。
  • 输入规模假设(当前、预期和压力测试范围)。
  • 资源预算(延迟目标、吞吐量目标、内存限制)。
  • 运行时上下文(I/O模式、缓存行为、并发竞争)。

Deliverables

交付成果

  • Complexity report with worst-case, average-case, and amortized bounds (as applicable).
  • Memory and auxiliary-space analysis, including peak usage assumptions.
  • Budget-fit assessment and scalability breakpoints.
  • Recommendation with residual risk and monitoring triggers.
  • 包含最坏情况、平均情况和摊销边界(如适用)的复杂度报告。
  • 内存和辅助空间分析,包括峰值使用假设。
  • 预算适配性评估和可扩展性断点。
  • 包含剩余风险和监控触发条件的建议。

Quality Standard

质量标准

  • Complexity claims are tied to explicit assumptions and units.
  • Dominant operations and constants relevant at target scale are identified.
  • CPU, memory, I/O, and contention effects are addressed where applicable.
  • Analysis states confidence level and uncertainty sources.
  • Decision includes conditions that would invalidate the current choice.
  • 复杂度结论需与明确的假设和单位挂钩。
  • 识别出在目标规模下相关的核心操作和常数项。
  • 适当时需考虑CPU、内存、I/O和竞争的影响。
  • 分析需说明置信水平和不确定性来源。
  • 决策需包含会使当前选择失效的条件。

Workflow

工作流程

  1. Define workload model, scale assumptions, and performance budgets.
  2. Derive formal bounds for each candidate's critical operations.
  3. Evaluate real-world cost drivers (constants, I/O, cache, contention).
  4. Compare candidates against budgets and identify breakpoints.
  5. Publish recommendation, residual risks, and re-evaluation triggers.
  1. 定义工作负载模型、规模假设和性能预算。
  2. 推导每个候选方案关键操作的正式边界。
  3. 评估实际成本驱动因素(常数项、I/O、缓存、竞争)。
  4. 对比候选方案与预算,识别断点。
  5. 发布建议、剩余风险及重新评估触发条件。

Failure Conditions

失败条件

  • Stop when workload/scale assumptions are missing.
  • Stop when dominant cost drivers are unmodeled.
  • Escalate when no candidate can satisfy mandatory budgets.
  • 当工作负载/规模假设缺失时,停止操作。
  • 当核心成本驱动因素未建模时,停止操作。
  • 当没有候选方案能满足强制预算时,升级处理。