bench/binary API

用途

bench/binary 收录 floating 的二进制算术和初等函数基准。它是纯测试包:所有内容都在基于 bench 工具集的 *_test.mbt 文件中,不导出任何 MoonBit 项。本页记录它定义的基准用例;教程说明如何运行,设计页解释工作负载。

导入

该包仅用于测试,不导出任何项,因此没有可从中导入的内容。它的测试以 @benchkit 导入该工具包,并导入被测包和 Maremark:

import {
  "Luna-Flow/floating-tools/bench" @benchkit,
  "Luna-Flow/floating/binary" @bin,
  "Luna-Flow/floating/binary_checked" @checked,
  "Luna-Flow/mare_mark/event",
  "Luna-Flow/mare_mark/experiment",
  "Luna-Flow/mare_mark/model",
  "Luna-Flow/mare_mark/runner",
  "moonbitlang/async",
} for "test"

基准用例

用例数据集实现协议
binary/add, binary/mul, binary/div53、128、512、2048 位kernel/coefficient(BigInt)、core/binary(Binary 运算符)、full/checked(BinaryChecked)Development
binary/elementary/OP,涵盖 28 个函数(exp、exp2、exp10、expm1、ln、log2、log10、log1p、sqrt、rootn、pow、hypot、sin、cos、tan、sinpi、cospi、tanpi、asin、acos、atan、atan2、sinh、cosh、tanh、asinh、acosh、atanh)53、128、512 位精度core/binary(会中止的方法)、full/checked(BinaryChecked)Development

每个规格都有一个在常规测试运行中执行的计划测试,用于检查它能编译(binary benchmark plans compile、elementary benchmark plans compile),以及一个标记为 #skip("performance benchmark") 的性能测试,只有 tools/benchmark.py 会运行它。在报告的行中,DATASET 是数据集列的从 0 开始的索引。性能测试把每个观测值以 MAREMARK_JSONL= 行流式输出,并打印归约后的结果:算术用 MAREMARK_HOTSPOT=binary/OP/DATASET core_pct=… full_pct=…,初等函数用 MAREMARK_HOTSPOT=binary/elementary/OP/DATASET full_pct=…。

完整公共接口

该包不导出任何 MoonBit 项。

// Generated using `moon info`, DON'T EDIT IT
package "Luna-Flow/floating-tools/bench/binary"

// Values

// Errors

// Types and methods

// Type aliases

// Traits