Skip to content

Performance

BitCal treats performance as an evidence discipline, not as ambient marketing. This section now renders from the retained benchmark artifacts committed under benchmarks/results/retained/, so the public tables and the repository evidence stay coupled.

Baseline snapshot

Current evidence target
avx2 on x86-64
Status of numbers
Retained checkpoint
Published statistic
median ns/op

Each row comes from the committed summary artifact, not a hand-picked run.

Committed source
007c74071b25
ARM status
ARM rows stay blank

No retained ARM benchmark path exists yet.

What is not promised
Universal wins

Committed local numbers are checkpoints, not blanket product guarantees.

The retained baseline now follows the shipped vNext public surface: bit_and, bit_or, bit_xor, bit_andnot, popcount, equals, is_zero, shift_left, and shift_right.

ARM rows stay blank until the project retains an ARM benchmark path with the same level of reproducibility and committed artifacts.

128-bit retained operationsRetained baseline on avx2 (007c74071b25)
OperationBitCal (ns)std::bitset (ns)Ratio
bit_and<128>10.590.530.05x
bit_or<128>10.640.530.05x
bit_xor<128>10.770.550.05x
bit_andnot<128>10.820.530.05x
popcount<128>1.080.270.25x
equals<128>0.270.271.00x
is_zero<128>1.071.020.95x
shift_left<128>11.120.530.05x
shift_right<128>11.070.860.08x
192-bit retained operationsCustom-width checkpoint kept in the retained baseline
OperationBitCal (ns)std::bitset (ns)Ratio
bit_and<192>10.951.980.18x
bit_or<192>11.182.030.18x
bit_xor<192>10.031.520.15x
bit_andnot<192>10.041.510.15x
popcount<192>1.511.511.00x
equals<192>0.260.261.00x
is_zero<192>0.510.511.00x
shift_left<192>10.049.530.95x
shift_right<192>10.032.010.20x
256-bit retained operationsRepresentative fixed-width checkpoint on the active x86-64 path
OperationBitCal (ns)std::bitset (ns)Ratio
bit_and<256>1.011.011.00x
bit_or<256>1.011.011.00x
bit_xor<256>1.011.011.00x
bit_andnot<256>1.011.011.00x
popcount<256>2.012.011.00x
equals<256>0.260.261.00x
is_zero<256>0.950.961.00x
shift_left<256>10.0310.031.00x
shift_right<256>10.0310.031.00x
512-bit retained operationsLarger-width public algorithms on the retained path
OperationBitCal (ns)std::bitset (ns)Ratio
bit_and<512>2.012.011.00x
bit_or<512>2.012.011.00x
bit_xor<512>2.012.011.00x
bit_andnot<512>2.012.011.00x
popcount<512>4.024.021.00x
equals<512>0.260.261.00x
is_zero<512>0.930.931.00x
shift_left<512>20.0620.061.00x
shift_right<512>11.0510.040.91x

What the current retained baseline actually says:

  • wins are narrower than the old hand-written table implied;
  • 128-bit and 192-bit operations are still broadly behind std::bitset, especially across the transform family;
  • 256-bit and 512-bit widths now show a mixed picture with a few isolated wins, several parity rows, and several losses;
  • equals is effectively at parity across the retained widths, which is useful because it shows the evidence chain is reporting the public surface rather than cherry-picking only dramatic outcomes.

Measurement methodology

Performance claims remain attached to a reproducible command path and interpretation rules.

Reproduction commands

bash
cmake -S . -B build-test -DCMAKE_BUILD_TYPE=Release -DBITCAL_BUILD_BENCHMARKS=ON -DBITCAL_NATIVE_ARCH=ON
cmake --build build-test --config Release --target benchmark_compare -j"$(nproc)"
./build-test/benchmarks/benchmark_compare --json-out benchmarks/results/retained/baseline-x86_64-avx2.json
node benchmarks/scripts/generate-performance-summary.mjs \
  benchmarks/results/retained/baseline-x86_64-avx2.json \
  benchmarks/results/retained/baseline-x86_64-avx2.summary.json

Benchmark binary split

The performance evidence on this page comes from benchmark_compare, not from the smaller bitcal_benchmark smoke executable used in the guide.

BinaryRole in the docs setWhy the split exists
benchmark_comparePublishes the retained vNext baseline for the shipped public algorithms and writes the raw JSON artifact.The baseline needs a reproducible comparison harness, a structured report, and an explicit claim boundary.
bitcal_benchmarkStays in Verification Path as the smoke-level executable baseline.Verification needs a lighter executable check that is distinct from the published comparison experiment.

Method rules

RuleWhy it exists
Treat current numbers as a retained baseline checkpointPrevent local benchmark output from becoming timeless marketing copy.
Publish table rows from per-scenario mediansMedian rows are less sensitive to occasional scheduling noise than a single best case or ad-hoc average.
Always report the active backend, CPU, and commit contextA speedup without ISA, machine, and revision context is meaningless.
Keep benchmark stories tied to public algorithm shapesNumbers should map back to documented public algorithms, not unnamed kernel trivia.
Keep retained evidence tied to the shipped public surfaceThe published comparison path should measure what the library actually ships today, not deleted compatibility layers.

Interpretation guardrails

  • Synthetic loops are useful, but they do not represent every workload.
  • An x86-64-first posture is a support choice, not proof that all other targets are equally mature.
  • A benchmark win in one algorithm family does not automatically justify a broader API or platform claim.
  • A benchmark loss is still valuable evidence; the point of the retained baseline is honesty, not theater.

Claim boundary

This section intentionally refuses to claim more than the evidence supports.

Safe claims today

  • BitCal retains a reproducible x86-64 benchmark path with committed raw and summary artifacts.
  • The retained baseline is grounded in named public algorithms, named widths, and explicit backend/commit context.
  • BitCal is not uniformly ahead of std::bitset yet, and the retained evidence makes that visible.

Claims that remain out of bounds

  • universal superiority over standard-library or specialized bitmap implementations;
  • equal maturity across ARM64, macOS, and future x86 backends;
  • workload-level promises that are not backed by retained traces or scenario-specific measurements.

Where performance work goes next

The next useful expansions are methodological, not theatrical:

  • aligned versus unaligned comparisons;
  • owner versus borrowed-view workload differences;
  • optional external comparators only when they stay clearly outside the retained headline path;
  • workload traces that complement the synthetic retained baseline.

For design context, return to the Whitepaper. For contract language, continue into the Reference. For external comparison material, use Research.

Whitepaper-first technical documentation for BitCal vNext.