THAMER
Sovereign Bitcoin Wallet

WALLET AI BITCOIN

Your Bitcoin Wallet. Your Keys. Your Engine.

Self-hosted Bitcoin software built for developers, applications, and AI agents.

CREATE WALLET

Bitcoin Agent Execution Latency Benchmark

permalink THAMER
#ai-agents#benchmarking#bitcoin#python

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

Python · 21 lines
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

Questions & Answers

Explore all questions →

Latest from the Lab

THAMER illustrated developer portrait and signature

ABOUT THE DEVELOPER

Independent Software Developer specializing in Bitcoin Script, Golang, and AI Agents.

Software engineering · Independent research · Open-source projects