1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// Copyright 2026 Thomas Santerre and Moderately AI Inc.
//
// SPDX-License-Identifier: MIT OR Apache-2.0
//! Consolidated criterion bench harness for interpretthis.
//!
//! One Cargo `[[bench]]` target; each layer/dimension lives in its own
//! sibling module. Same shape as `tests/integration/main.rs` — collapsing
//! seven separate bench binaries into one compile unit cuts bench-build
//! wall-clock proportionally on this dep graph.
//!
//! Modules:
//! - `eval` — eval-dispatch hot path (arithmetic / control flow)
//! - `frames` — function-call frame cost (recursion, closures, scope)
//! - `containers` — list / dict / set ops + comprehensions
//! - `dispatch` — builtin-type method dispatch
//! - `workloads` — cross-cutting realistic application snippets
//! - `memory` — peak memory_used_bytes accounting
//!
//! Each module exposes a `pub fn benches()` (via `criterion_group!`) that
//! this file collects into a single `criterion_main!` entry. Filter to one
//! group / one bench via criterion's CLI:
//!
//! ```text
//! cargo bench -- 'eval/' # whole eval group
//! cargo bench -- 'frames/recursive_fib_15' # one bench
//! cargo bench -- 'parallel_throughput/8' # criterion bench-id form
//! ```
// Bench-time global allocator selection. The crate itself is
// allocator-neutral; the bench binary opts in via feature flag so
// recorded numbers reflect the production allocator (jemalloc, same
// as a typical production host). Mimalloc is available as an A/B alternative.
//
// At most one of the two features may be enabled at a time —
// `#[global_allocator]` is a static item, multiple declarations fail
// to link.
static GLOBAL_JEMALLOC: Jemalloc = Jemalloc;
static GLOBAL_MIMALLOC: MiMalloc = MiMalloc;
criterion_main!;