---
title: "6. Benchmark method · perennial"
description: "Rules: same machine, pinned versions, warm-up, median of 5 cold processes per cell, raw JSON Lines committed, charts generated from them."
canonical: "https://perennial.avarok.net/docs/design/06-bench/"
lastmod: "2026-12-01T20:11:23Z"
tokens: 1079
---

1. [Docs](https://perennial.avarok.net/docs/)
2. [Design](https://perennial.avarok.net/docs/design/)

# 6\. Benchmark method

perennial@0.1.0·Updated 2026-12-01·1 min read·[View as markdown](https://perennial.avarok.net/docs/design/06-bench/index.md)

Rules: same machine, pinned versions, warm-up, median of 5 cold processes per cell, raw JSON Lines committed, charts generated from them.

## Contenders (pinned in bench/Cargo.toml)

perennial (this commit), imbl 7.0.2, im 15.1.0, im-rc 15.1.0, rpds 1.2.1, and std (`BTreeMap`, `HashMap`, `Vec`) as the ceiling. Each collection is used with its defaults (default hasher, default pointer kind) and, separately, the Rc flavour against im-rc and rpds' non-sync types.

## Workloads (n = 1,000, 100,000 and 1,000,000 unless stated)

| Id           | Workload                                                                                       | Types        |
| ------------ | ---------------------------------------------------------------------------------------------- | ------------ |
| insert       | build by n inserts of shuffled u64 keys                                                        | maps, sets   |
| lookup       | n successful lookups in shuffled order                                                         | maps, sets   |
| remove       | remove every key, shuffled                                                                     | maps, sets   |
| iterate      | sum all values by iterator                                                                     | all          |
| clone-mutate | clone, then 10 inserts, repeated n/10 times keeping every version alive                        | maps, Vector |
| push-back    | n `push_back`                                                                                  | Vector       |
| index        | read every index in order and in random order                                                  | Vector       |
| concat       | concat 1,000 vectors of n/1,000                                                                | Vector       |
| split        | split at random points until pieces are < 64, then rejoin                                      | Vector       |
| resolver     | replay of a cargo-resolver-shaped trace: OrdMap/HashMap context cloned at each backtrack point | maps, sets   |

Keys are `u64` from a fixed-seed generator; a `String` key variant runs for insert and lookup.

## Harness

`bench/` is a separate crate with one binary. Each invocation runs one (contender, workload, n) cell after a warm-up and prints one JSON line: contender and version, workload, n, ns per operation, rustc version, CPU, cores, RAM, OS, and the 1-minute load average at start. A driver script runs every cell in 5 fresh processes in random order and keeps all lines; charts and the README table use the median. Runs only when the 1-minute load is under 6 and no other benchmark is running on the machine.

## Outputs

`bench/results/<date>-<machine>.jsonl`, `bench/charts.json`, `scripts/bench-charts.mjs` → `assets/bench-*.svg` (light and dark) and the README table. CI re-renders and fails on a diff.

```json
{
  "@context": "https://schema.org",
  "@graph": [
    {
      "@id": "https://thomaspbraun.com/#person",
      "@type": "Person",
      "name": "Thomas Braun",
      "sameAs": [
        "https://github.com/tbraun96",
        "https://x.com/tbraun96"
      ],
      "url": "https://thomaspbraun.com",
      "worksFor": {
        "@type": "Organization",
        "name": "Avarok",
        "url": "https://avarok.net"
      }
    },
    {
      "@id": "https://perennial.avarok.net/docs/design/06-bench/",
      "@type": "WebPage",
      "author": {
        "@id": "https://thomaspbraun.com/#person"
      },
      "dateModified": "2026-12-01T20:11:23Z",
      "description": "Rules: same machine, pinned versions, warm-up, median of 5 cold processes per cell, raw JSON Lines committed, charts generated from them.",
      "inLanguage": "en",
      "isPartOf": {
        "@id": "https://perennial.avarok.net/#website",
        "@type": "WebSite",
        "name": "perennial",
        "url": "https://perennial.avarok.net/"
      },
      "name": "6. Benchmark method · perennial",
      "url": "https://perennial.avarok.net/docs/design/06-bench/"
    }
  ]
}
```
