Bitcoin Agent Resource Consumption Benchmark
Bitcoin Agent Resource Consumption Benchmark
Method and scope
Measure elapsed time, process CPU time and peak traced Python allocations. Tracemalloc excludes many native allocations and is not container RSS. Run in an isolated process; instrumentation adds overhead.
Independent reference implementation
1import tracemalloc
2from time import perf_counter_ns, process_time_ns
3
4def profile(operation):
5 if tracemalloc.is_tracing():
6 raise RuntimeError("requires independent tracing session")
7 tracemalloc.start()
8 try:
9 wall, cpu = perf_counter_ns(), process_time_ns()
10 operation()
11 elapsed, consumed = perf_counter_ns()-wall, process_time_ns()-cpu
12 _, peak = tracemalloc.get_traced_memory()
13 return {"wall_ns": elapsed, "cpu_ns": consumed, "python_peak_bytes": peak}
14 finally:
15 tracemalloc.stop()
16
17if __name__ == "__main__":
18 result = profile(lambda: list(range(10000)))
19 assert result["python_peak_bytes"] > 0 and not tracemalloc.is_tracing()
20 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
