benchmarks

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package benchmarks ports the dmonad/crdt-benchmarks B1-B4 workload suite to ygo. The benchmark IDs (B1.1 .. B4) match the upstream spec verbatim so cross-implementation comparison stays apples-to- apples — see README in https://github.com/dmonad/crdt-benchmarks for the canonical descriptions.

Methodology per benchmark:

  • "ops" sub-benchmark times the workload itself (mutations into a fresh Doc), no encode.
  • "encode_v1" / "encode_v2" sub-benchmarks time the wire encoder against a pre-built Doc; report doc-size in bytes via b.ReportMetric.
  • "parse_v1" / "parse_v2" sub-benchmarks time DecodeUpdate + Apply against a fresh receiver Doc.

Run: go test -bench=. -benchmem ./benchmarks/ Run one: go test -bench=B1_1 -benchmem ./benchmarks/

B4 expects the upstream automerge-paper trace at testdata/b4-trace.json.gz — skipped if absent. See testdata/gen/fetch-b4-trace.sh.

Index

Constants

View Source
const N = 6000

N is the canonical operation count per dmonad/crdt-benchmarks B1 workloads (6,000 ops). Kept as a const so all B1.x scenarios use the same scale for cross-comparison.

View Source
const N2 = N / 2

N2 is the per-peer op count for B2 concurrent workloads. Each of two peers does N2 ops, so total ops is 2*N2 = 6000 (matches B1).

View Source
const N3 = 489

N3 is the client count for B3 high-conflict workloads. Spec says "20 * sqrt(N)" where N=600 → 489 clients. We use the spec value directly rather than recomputing.

Variables

This section is empty.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL