motoko-benchmarks-generation

Create Motoko bench units with bench-helper for standardized performance tests.

Updated Mar 19, 2026
One-click install
npx skills add https://github.com/research-ag/motoko-skills --skill motoko-benchmarks-generation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: motoko-benchmarks-generation
Source: https://github.com/research-ag/motoko-skills/tree/main/skills/benchmarks-generation
Command: npx skills add https://github.com/research-ag/motoko-skills --skill motoko-benchmarks-generation

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Motoko benchmarks often lack structure; bench-helper standardizes how to describe and run bench tests, enabling repeatable measurements across projects.

Core Features & Use Cases

  • Bench schema: define name, rows, cols, and a run function; one bench file per module; a runner discovers all benches consistently.
  • Project setup: uses mops.toml and mo:core/mo:base compatibility; supports mo:base can still run benches.
  • Safe patterns: guidance for encode/decode, hashing, crypto, and allocation benches to ensure deterministic results.

Quick Start

Create a new bench using bench-helper and place bench files under bench/ with a simple init() that returns a Bench.V1 instance

Frequently Asked Questions about motoko-benchmarks-generation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I standardize Motoko benchmarks for consistent performance testing?

You can standardize Motoko benchmarks using the bench-helper schema to define name, rows, cols, and a run function, ensuring repeatable performance measurements across Mo projects. One bench file is created per module for consistent discovery.

What is the best way to structure Motoko bench files for mo:base and mo:core?

The best way to structure Motoko bench files is placing them under a bench/ directory with a simple init() returning a Bench.V1 instance. This setup uses mops.toml and supports both mo:base and mo:core compatibility.

How do I ensure deterministic results in Motoko performance benchmarks?

To ensure deterministic results in Motoko performance benchmarks, follow safe pattern guidance for encode/decode, hashing, crypto, and allocation operations. These patterns prevent inconsistent measurements during bench execution.

Does bench-helper work with existing mo:base canister projects?

Yes, bench-helper works with existing mo:base canister projects and supports mo:base can still run benches. It requires mops.toml for project setup and is compatible across mo:base and mo:core environments.

Why do my Motoko benchmarks lack structure and produce inconsistent measurements?

Motoko benchmarks lack structure when they do not use a standardized schema like bench-helper. Implementing a frontmatter-defined name and description with a runnable bench schema ensures repeatable measurements across projects.

How do I set up a Motoko bench unit using bench-helper?

To set up a Motoko bench unit, create a new bench using bench-helper and place bench files under the bench/ directory. A simple init() function returns a Bench.V1 instance, allowing a runner to discover all benches consistently.