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

motoko-benchmarks-generationmotoko 基准测试生成

Agent Skill

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

总安装

165

周安装

7

GitHub Stars

公开资料未说明

下载量

58
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/research-ag/motoko-skills --skill motoko-benchmarks-generation

简介

motoko-benchmarks-generation 用于查找、检索和筛选相关信息。

  • 适合根据关键词、任务场景或来源线索快速定位候选结果。
  • 可通过 npx skills add 命令从指定仓库安装,需结合原始 README 核验用法。
  • 安装前建议确认权限范围、维护状态及是否触发联网或文件读写。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Motoko Benchmarks with bench‑helper

What This Is

bench-helper is a tiny Motoko library that standardizes how to write benchmarks. You describe a benchmark using a small schema (name, rows, cols), provide a run(row, col) function, and return a versioned bench record. Each file under bench/*.bench.mo defines one benchmark module. A runner can then discover and execute all benches consistently.

Prerequisites

mops.toml (add dependencies and toolchain)

If you already have a mops.toml, just add bench-helper under [dev-dependencies]. If your project still uses mo:base instead of mo:core, you can keep it — benches themselves can be written with mo:base without affecting your runtime canisters.

Directory & File Conventions

  • Put benches under bench/ at the repo root.
  • Name files with the suffix .bench.mo, one benchmark per file; for example: bench/base64.bench.mo.
  • Each bench file is a Motoko module {...} that exposes a single public func init(): Bench.V1 function.
  • Inside init, construct a Bench.Schema and return Bench.V1(schema, run) where run: (rowIndex: Nat, colIndex: Nat) -> () performs the measured operation.

Minimal skeleton

import Array "mo:core/Array";
import Text  "mo:core/Text";
import Bench "mo:bench-helper";

module {
  public func init() : Bench.V1 {
    let schema : Bench.Schema = {
      name = "My bench";
      description = "What this bench measures";
      rows = ["size 16", "size 64", "size 256"]; // your row labels
      columns = ["operation A", "operation B"];  // your column labels
    };

    // Prepare inputs outside of `run` so they are not re-created on every iteration
    let inputs : [[Nat8]] = [
      Array.init<Nat8>(16, 0),
      Array.init<Nat8>(64, 0),
      Array.init<Nat8>(256, 0),
    ];

    // Build a table of routines to measure: routines[row][col] : () -> ()
    let routines : [[() -> ()]] = Array.tabulate(
      rows.size(),
      func(ri) {
        let input = inputs[ri]; // capture precomputed input
        [
          func() { ignore input.size() },    // operation A @ inputs[ri]
          func() { ignore input.toArray() }, // operation B @ inputs[ri]
        ]
      },
    );

    // The runner calls this many times; keep it tiny and branch-free.
    Bench.V1(schema, func(ri : Nat, ci : Nat) = routines[ri][ci]());
  };
};

Note: if you're not using "core" dependency, replace "mo:core" imports with "mo:base"

How It Works

  • Schema

- name and description describe the bench. - rows enumerate different operations or variants you measure (e.g., "encode", "decode"). - cols enumerate different input categories (e.g., message sizes).

  • Runner contract

- You return a versioned record Bench.V1(schema, run); the runner calls run(rowIndex, colIndex) many times to record timings. - Side effects/results inside run should be consumed (e.g., ignore...) to prevent dead‑code elimination.

Common Pitfalls

  1. Rows/cols mismatch

- Ensure your routines table has dimensions rows.size() x cols.size(). If you add or remove a row/col label, update how you build routines; otherwise some cells will be no‑ops.

  1. Doing expensive setup inside run

- Generate inputs once in init and capture them in closures. Only do the core operation in run.

  1. Forgetting to consume results

- Use ignore to consume return values; otherwise the compiler might drop the call as dead code.

  1. Non‑determinism and timing noise

- Keep run free of logging/printing and random allocation; keep GC pressure comparable across rows.

More examples

bench-helper reference benches: https://github.com/research-ag/bench-helper/tree/main/bench

Verify It Works

The exact runner/command may vary depending on your environment. After adding bench-helper to mops.toml and writing .bench.mo files:

  • Ensure your project resolves dependencies: mops install
  • Run benchmarks: mops bench
  • Consult the bench-helper package README for the latest recommended runner command for your toolchain/version.

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

33.93%
按下载量换算20

Claude

35.25%
按下载量换算20

Cursor

19.09%
按下载量换算11

Gemini CLI

8.89%
按下载量换算5

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

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

安装前确认

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

来源信息

继续浏览同类 Skills