Skip to content
cccskills
FreePublished on GitHub

bench

构建并运行 vlink-bench 性能基准(showcase/quick/full 预设),生成 HTML/JSON 报告。用户要求"跑 bench"、"性能测试"、对比后端吞吐/延迟、 验证性能回归时使用。

The English summary is being prepared. Showing the original description.

thun-res/vlink115 stars(GitHub 115 + cccskills 0)

Run score Not tested

See how to install

Files included (2)

  • SKILL.md4.9 KB
  • agents/openai.yaml198 B

SKILL.md (original)

Review the instructions the agent will receive before you install.

性能基准测试

vlink-bench 是仓库自带的基准 CLI(cli/bench/),由默认开启的 ENABLE_CLI_BENCH=ON 构建,二进制位于 build-ai/skill_bench/output/bin/vlink-bench。 官方 Wiki 的基准页即来自 quick 预设的一次运行 (.github/scripts/release-bench.sh)。

1. 构建

Linux / macOS:

REPO_ROOT="$(git rev-parse --show-toplevel)"
BUILD_DIR="$REPO_ROOT/build-ai/skill_bench"
export PYTHONPYCACHEPREFIX="$BUILD_DIR/__pycache__"
PHYSICAL_CORES=
case "$(uname -s 2>/dev/null)" in
  Linux)
    PHYSICAL_CORES="$(
      LC_ALL=C lscpu -p=CORE,SOCKET 2>/dev/null |
        awk -F, '
          $1 !~ /^#/ && $1 ~ /^[0-9]+$/ && $2 ~ /^[0-9]+$/ {
            cores[$2 SUBSEP $1] = 1
          }
          END {
            for (core in cores) {
              count++
            }
            if (count > 0) {
              print count
            }
          }'
    )" || PHYSICAL_CORES=
    ;;
  Darwin)
    PHYSICAL_CORES="$(sysctl -n hw.physicalcpu 2>/dev/null)" || PHYSICAL_CORES=
    ;;
esac
case "$PHYSICAL_CORES" in
  '' | *[!0-9]* | 0) PHYSICAL_CORES=1 ;;
esac
if [ "$PHYSICAL_CORES" -gt 1 ]; then
  BUILD_JOBS=$((PHYSICAL_CORES - 1))
else
  BUILD_JOBS=1
fi
cmake -S "$REPO_ROOT" -B "$BUILD_DIR" \
  -DENABLE_CXX_STD_20=OFF \
  -DENABLE_CLI_BENCH=ON
cmake --build "$BUILD_DIR" --target vlink-bench --parallel "$BUILD_JOBS"

Windows PowerShell:

$RepoRoot = git rev-parse --show-toplevel
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
$BuildDir = Join-Path (Join-Path $RepoRoot "build-ai") "skill_bench"
$env:PYTHONPYCACHEPREFIX = Join-Path $BuildDir "__pycache__"
try {
    $Processors = @(Get-CimInstance -ClassName Win32_Processor -ErrorAction Stop)
    if ($Processors.Count -eq 0) {
        throw "No processor information"
    }
    $PhysicalCores = 0
    foreach ($Processor in $Processors) {
        $Cores = [int]$Processor.NumberOfCores
        if ($Cores -lt 1) {
            throw "Invalid physical core count"
        }
        $PhysicalCores += $Cores
    }
} catch {
    $PhysicalCores = 1
}
$BuildJobs = [Math]::Max($PhysicalCores - 1, 1)
& cmake -S $RepoRoot -B $BuildDir `
  -DENABLE_CXX_STD_20=OFF `
  -DENABLE_CLI_BENCH=ON
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
& cmake --build $BuildDir --target vlink-bench --parallel $BuildJobs
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }

若 build-ai/skill_bench 已配置过、配置仍适用且未被其他任务使用, 可直接执行第二条;否则使用 skill_bench_<task_name>。配置失败必须原样 报告,不得继续使用陈旧构建目录或清理其他构建目录。

2. 运行

与 CI 发布报告一致的跑法:

Linux / macOS:

BENCH_REPORT_DIR="$(mktemp -d)"
"$BUILD_DIR/output/bin/vlink-bench" run \
  --preset quick \
  --report html,json \
  --silent \
  -o "$BENCH_REPORT_DIR/vlink-bench-report"

Windows PowerShell:

$BenchReportDir = Join-Path ([System.IO.Path]::GetTempPath()) (
  "vlink-bench-" + [guid]::NewGuid()
)
New-Item -ItemType Directory -Path $BenchReportDir | Out-Null
$Bench = Join-Path $BuildDir "output\bin\vlink-bench.exe"
$Output = Join-Path $BenchReportDir "vlink-bench-report"
& $Bench run --preset quick --report html,json --silent -o $Output
  • --preset:showcase(默认,演示)/ quick(CI 用,较快)/ full(完整矩阵,耗时长)。
  • --mode:运行形态 local-direct、local-loop 或 process; 传输后端通过 --url 选择。
  • -o/--output:报告文件前缀(不含扩展名),生成 .html / .json。
  • 每次使用独立 mktemp 目录,避免并发运行或重复执行覆盖报告;完成后报告 该目录,由用户决定保留或删除。
  • 其他子命令:plot(由 JSON 重绘报告)、pub/sub(跨进程手动 压测端)。完整参数见 vlink-bench run --help。

3. 结果处理

  • 基准数据受宿主机负载影响大:对比性能回归时,before/after 必须在同一台 空闲机器、同一预设下运行;正式对比使用 full --repeat 3。
  • $BUILD_JOBS / BuildJobs 必须严格等于 max(真实物理核心数 - 1, 1)。禁止改用逻辑 CPU 数、裸 --parallel/-j 或固定高并行度;无法可靠获取时固定单核,且同一 时刻只运行一个本地构建,防止编译卡死或耗尽内存。
  • 涉及性能结论时,引用 JSON 报告中的具体指标(吞吐/延迟分位数),不凭 单次 HTML 观感下结论。
  • 退出码 2 表示运行和报告生成完成,但存在失败 case;仍需读取 JSON 定位失败项,不得误报为命令执行故障。其他非零退出码按执行失败处理。
  • 只在用户显式调用本 skill 时才执行构建与运行;日常改码流程仍遵循 AGENTS.md 强制规则第 3 条(不主动构建)。

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

asan

Free

以 AddressSanitizer(ENABLE_TEST_SANITIZE=ON)构建并运行 vlink-test 单元测试,复现 CI 的 ASan 门禁。用户要求"跑 asan"、"内存检测测试"、 排查 ci-test 的 sanitize 失败时使用。

The English summary is being prepared. Showing the original description.

thun-res/vlink115Updated Oct 15, 2026

check

Free

运行 tools/check.sh 对整个仓库执行 cpplint 静态检查(120 列,项目定制 过滤集)。用户要求"跑 check"、"cpplint 检查"、排查 CI lint 门禁失败 时使用。

The English summary is being prepared. Showing the original description.

thun-res/vlink115Updated Oct 15, 2026

cicd

Free

用 gh CLI 触发/查看 GitHub CI/CD:手动 dispatch 工作流 (release/coverage/docker)、查看运行状态与失败日志、重跑失败 job. 用户要求"触发 CI"、"看流水线"、"重跑失败的 job"时使用;创建 dev 到 master 的 PR 使用 /pr,正式发版使用 /release.

The English summary is being prepared. Showing the original description.

thun-res/vlink115Updated Oct 15, 2026

对指定文件或全仓库运行 clang-tidy(WarningsAsErrors='*')。用户要求 "跑 clang-tidy"、"tidy 检查某文件"、排查 CI tidy 门禁失败时使用。

The English summary is being prepared. Showing the original description.

thun-res/vlink115Updated Oct 15, 2026

commit

Free

提交前强制执行 VLink 的 format 与 check skill,再分析当前工作树的全部 staged、unstaged 与 untracked 改动,按模块、功能和依赖关系拆分为可独立 评审的 Conventional Commits,生成简洁且覆盖重要行为的英文 commit message 并逐组提交。用户要求“提交当前改动”、“按功能拆 commit”、 “自动写 commit msg”或“整理提交历史”时使用。

The English summary is being prepared. Showing the original description.

thun-res/vlink115Updated Oct 15, 2026

以 ENABLE_TEST_COVERAGE=ON 构建、运行测试并生成 lcov 代码覆盖率报告, 复现 CI 的 coverage 流水线。用户要求"跑覆盖率"、"生成 coverage 报告"、查某模块覆盖情况时使用。

The English summary is being prepared. Showing the original description.

thun-res/vlink115Updated Oct 15, 2026

See all skills by thun-res

Report a problem with this skill