weather-pipeline-performance-diagnosis
它能做什么
这个工具可以帮你找出天气数据获取和处理流程中,哪一个环节耗时过长。它会分别测量每个步骤的耗时,让你在动手修复之前就清楚地知道问题出在哪里。
适用场景
- ✓当天气数据工作流的运行速度明显比平时慢时。
- ✓当你怀疑某个程序速度慢,但又缺乏证据时。
- ✓当你想在修改前后对比性能时。
技能链接
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/weather-pipeline-performance-diagnosis/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“帮我找出天气数据处理流程中,哪个阶段运行得太慢。”
每周 5 个新技能,1 分钟读完。
工作原理
工具会把整个工作流拆分成若干部分(例如获取数据、处理数据、渲染输出),并分别测量每部分的耗时。这样就能找出最慢的环节,而且无需改动代码本身。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Weather Pipeline Performance Diagnosis
Overview
Find the stage that actually makes a weather workflow slow before optimizing it. Measure the real runtime path from source discovery through the final artifact, including optional companion data and fallback work.
This skill diagnoses latency and throughput. It does not prescribe a particular data provider, file format, decoder, or optimization.
When to Use This Skill
- A fetch, sounding, map, animation, or batch job feels slower than before.
- A parser or native backend is blamed without stage-level timing evidence.
- Local runs and packaged or hosted runs have different performance.
- A cache, provider fallback, optional enrichment, or rendering step may hide the real cost.
- A proposed performance fix needs a repeatable before-and-after comparison.
Do not activate this skill for a correctness bug unless performance is also part of the observed failure.
Reproduce the Real Path
Record one fixed workload before editing code:
- requested source, time, location, variables, and output;
- application commit and runtime version;
- active implementation or backend, including fallback reason;
- cold-cache or warm-cache state;
- machine, operating system, worker count, and relevant resource limits;
- bytes transferred and final artifact size;
- whether optional guidance, overlays, or secondary sources were enabled.
Use the same workload for the baseline and candidate measurement. A faster run with fewer inputs or a warm cache is not evidence that the original path improved.
Divide the Pipeline into Stages
At minimum, time these boundaries independently:
- request validation and source discovery;
- availability checks and fallback selection;
- network transfer or cache read;
- parsing or decoding;
- supplemental-data retrieval;
- profile, grid, or derived-value construction;
- visualization or export;
- cleanup and final publication.
Add sub-stages only where the first pass shows meaningful time. Preserve the existing behavior while instrumenting; diagnostics must not silently disable expensive work.
Lightweight Timing Example
Use a monotonic clock and emit structured records that can be compared across runs:
import json
import time
from contextlib import contextmanager
@contextmanager
def timed_stage(name, report):
started = time.perf_counter()
outcome = "ok"
try:
yield
except BaseException:
outcome = "error"
raise
finally:
report.append({
"stage": name,
"outcome": outcome,
"seconds": round(time.perf_counter() - started, 6),
})
timings = []
with timed_stage("source_discovery", timings):
source = discover_source()
with timed_stage("transfer", timings):
local_path = fetch_source(source)
with timed_stage("processing", timings):
result = build_result(local_path)
print(json.dumps(timings, sort_keys=True))
Instrument production boundaries or the same public APIs used by production. Avoid a benchmark helper that bypasses the path users report as slow.
Interpret the Evidence
- Long discovery with little transfer suggests broad listings, excessive retries, provider timeouts, or repeated availability probes.
- Long transfer with expected parsing time suggests bandwidth, object size, throttling, or failure to reuse a valid cache.
- Long parsing requires proof that the intended backend is active and that the input volume is comparable.
- Long processing after parsing points to interpolation, secondary retrieval, profile construction, or repeated computation.
- Long rendering can come from layout, rasterization, font loading, excessive redraws, or large output dimensions.
- High variance across identical runs suggests external services, contention, cold starts, garbage collection, or uncontrolled parallelism.
Measure wall time, CPU time, bytes, item counts, cache state, and worker count where they explain the result. A single total duration cannot locate a bottleneck.
Validate a Fix
- Preserve the baseline report and environment description.
- Change the smallest shared cause supported by the measurements.
- Rerun the identical workload several times in the same cache state.
- Compare the affected stage, total duration, output identity, and resource use.
- Run correctness tests for the changed path.
- Report both improvement and measurement variability.
…
常见问题
为什么不能只测总耗时?
只测总耗时无法告诉你具体哪个环节慢。这就像知道一次出行花了很长时间,却不知道是堵车、中途停留还是在目的地耗费了时间。
什么是“阶段”?
阶段指流程中的不同部分,例如下载数据、读取数据、进行计算以及准备显示内容。
使用这个工具需要修改代码吗?
需要做一点修改。你需要在流程的每个步骤中添加少量计时代码,这样工具才能记录每一步各花了多长时间。
详情
作者的原始描述
Diagnose slow weather-data workflows by measuring discovery, transfer, parsing, scientific processing, and rendering separately before changing code.
热度
- GitHub 星标
- 48k
- 排名
- #6149
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
00-andruia-consultant
48k帮你的智能体启动或改进 AI 项目。它可以分析代码、推荐工具,并用西班牙语制定行动计划。
007
48k让你的智能体执行安全审计和威胁建模。它有助于保护项目免受攻击和漏洞的威胁。
10-andruia-skill-smith
48k帮你的智能体创建或改进 AI 工具。它可以定义工具的工作方式、编写文档,并验证其结构。
20-andruia-niche-intelligence
48k让你的智能体创建某个特定行业的摘要。它有助于借助可靠的信息来源,了解项目的背景、规则、使用模式和风险。