Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计通过

performance性能

Agent Skill

performance 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

2,105

周安装

86

GitHub Stars

38,597

下载量

681
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:performance(性能)
来源仓库:https://github.com/rtk-ai/rtk
仓库路径:skills/performance
安装命令:
npx skills add https://github.com/rtk-ai/rtk --skill performance
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/rtk-ai/rtk --skill performance

简介

performance 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。

  • 适用于信息调研、资料搜集和线索筛选等研究类任务场景。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装并使用。
  • 安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

RTK Performance Analysis

Hard Targets (Non-Negotiable)

MetricTargetBlocker
Startup time<10msRelease blocker
Binary size (stripped)<5MBRelease blocker
Memory (resident)<5MBRelease blocker
Token savings per filter≥60%Release blocker

Benchmark Startup Time

# Install hyperfine (once)
brew install hyperfine

# Baseline (before changes)
hyperfine 'rtk git status' --warmup 3 --export-json /tmp/before.json

# After changes — rebuild first
cargo build --release

# Compare against installed
hyperfine 'target/release/rtk git status' 'rtk git status' --warmup 3

# Target: <10ms mean time

Check Binary Size

# Release build with strip=true (already in Cargo.toml)
cargo build --release
ls -lh target/release/rtk
# Should be <5MB

# If too large — check what's contributing
cargo bloat --release --crates
cargo bloat --release -n 20
# Install: cargo install cargo-bloat

Memory Usage

# macOS
/usr/bin/time -l target/release/rtk git status 2>&1 | grep "maximum resident"
# Target: <5,000,000 bytes (5MB)

# Linux
/usr/bin/time -v target/release/rtk git status 2>&1 | grep "Maximum resident"
# Target: <5,000 kbytes

Regex Compilation Audit

Regex compilation on every function call is a common perf killer:

# Find all Regex::new calls
grep -n "Regex::new" src/*.rs

# Verify ALL are inside lazy_static! blocks
# Any Regex::new outside lazy_static! = performance bug
// ❌ Recompiles on every filter_line() call
fn filter_line(line: &str) -> bool {
    let re = Regex::new(r"^error").unwrap();  // BAD
    re.is_match(line)
}

// ✅ Compiled once at first use
lazy_static! {
    static ref ERROR_RE: Regex = Regex::new(r"^error").unwrap();
}
fn filter_line(line: &str) -> bool {
    ERROR_RE.is_match(line)  // GOOD
}

Dependency Impact Assessment

Before adding any new crate:

# Check startup impact (measure before adding)
hyperfine 'rtk git status' --warmup 3

# Add dependency to Cargo.toml
# Rebuild
cargo build --release

# Measure after
hyperfine 'target/release/rtk git status' --warmup 3

# If startup increased >1ms — investigate
# If startup increased >3ms — reject the dependency

Forbidden dependencies

CrateReasonAlternative
tokio+5-10ms startupBlocking std::process::Command
async-std+5-10ms startupBlocking I/O
rayonThread pool init overheadSequential iteration
reqwestPulls tokioureq (blocking) if HTTP needed

Dependency weight check

# After cargo build --release
cargo build --release --timings
# Open target/cargo-timings/cargo-timing.html
# Look for crates with long compile times (correlates with complexity)

Allocation Profiling

# macOS — use Instruments
instruments -t Allocations target/release/rtk git log -10

# Or use cargo-instruments
cargo install cargo-instruments
cargo instruments --release -t Allocations -- git log -10

Common RTK allocation hotspots:

// ❌ Allocates new String on every line
let lines: Vec<String> = input.lines().map(|l| l.to_string()).collect();

// ✅ Borrow slices
let lines: Vec<&str> = input.lines().collect();

// ❌ Clone large output unnecessarily
let raw_copy = output.stdout.clone();

// ✅ Use reference until you actually need to own
let display = &output.stdout;

Token Savings Measurement

// In tests — always verify claims
fn count_tokens(text: &str) -> usize {
    text.split_whitespace().count()
}

#[test]
fn test_savings_claim() {
    let input = include_str!("../tests/fixtures/mycmd_raw.txt");
    let output = filter_output(input).unwrap();

    let input_tokens = count_tokens(input);
    let output_tokens = count_tokens(&output);
    let savings = 100.0 * (1.0 - output_tokens as f64 / input_tokens as f64);

    assert!(
        savings >= 60.0,
        "Expected ≥60% savings, got {:.1}% ({} → {} tokens)",
        savings, input_tokens, output_tokens
    );
}

Before/After Regression Check

Template for any performance-sensitive change:

# 1. Baseline
cargo build --release
hyperfine 'target/release/rtk git status' --warmup 5 --export-json /tmp/before.json
/usr/bin/time -l target/release/rtk git status 2>&1 | grep "maximum resident"
ls -lh target/release/rtk

# 2. Make changes
# ... edit code ...

# 3. Rebuild and compare
cargo build --release
hyperfine 'target/release/rtk git status' --warmup 5 --export-json /tmp/after.json
/usr/bin/time -l target/release/rtk git status 2>&1 | grep "maximum resident"
ls -lh target/release/rtk

# 4. Compare
# Startup: jq '.results[0].mean' /tmp/before.json /tmp/after.json
# If after > before + 1ms: investigate
# If after > 10ms: regression, do not merge

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.06%
按下载量换算252

Claude

28.16%
按下载量换算192

Cursor

21.27%
按下载量换算145

Gemini CLI

10.15%
按下载量换算69

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills