Bitcoin Agent Execution Latency Benchmark
Bitcoin Agent Execution Latency Benchmark
Method and scope
Measure a local deterministic operation with a monotonic clock. Report nearest-rank percentiles and sample count; warm-up is excluded. This measures only the supplied callable, not network or confirmation latency.
Independent reference implementation
1from time import perf_counter_ns
2from math import ceil
3
4def measure(operation, samples=1000, warmup=100):
5 if samples < 1 or warmup < 0:
6 raise ValueError("invalid sample count")
7 for _ in range(warmup):
8 operation()
9 times = []
10 for _ in range(samples):
11 start = perf_counter_ns()
12 operation()
13 times.append(perf_counter_ns() - start)
14 times.sort()
15 return {"samples": samples, **{f"p{p}_ns": times[ceil(p*samples/100)-1] for p in (50, 95, 99)}}
16
17if __name__ == "__main__":
18 result = measure(lambda: sum(range(100)))
19 assert result["samples"] == 1000
20 assert 0 <= result["p50_ns"] <= result["p95_ns"] <= result["p99_ns"]
21 print(result)Reproducibility
Run the example with Python 3. Record the Python version, host resources and workload parameters. Repeat measurements on an idle host and report variation rather than selecting the fastest run. The assertions verify synthetic behavior only. No wallet credentials, live SEND or changes to the immutable fee law are involved.
Related research
https://thamer.org/learn/bitcoin-for-ai-agents-open-integration-guide
https://thamer.org/api
