This project serves as a performance benchmarking suite to measure and compare Agent-to-Agent (A2A) protocol communication and tool execution performance across multiple programming languages: Python, Go, Node.js (TypeScript), and Rust.
The benchmark runs an agent in each language that implements a tool to calculate the first
The suite consists of the following components:
- Master Coordinator Agent (Python): Orchestrates benchmarks by calling sub-agents via the A2A protocol and measuring execution times. Exposes a FastMCP interface on port
8100. - Python Benchmark Agent: Calculates Mersenne primes using the Lucas-Lehmer test, exposed as an A2A app on port
8101. - Go Benchmark Agent: Calculates Mersenne primes, built with the Go implementation of ADK, running on port
8102. - Node.js Benchmark Agent: Written in TypeScript using
@a2a-js/sdk, running on port8103. - Rust Benchmark Agent: Written in Rust using the
axumweb framework andnum_bigintcrate, running on port8104.
| Component / Agent | Language | Port | Type |
|---|---|---|---|
| Master Coordinator | Python | 8100 |
FastMCP Server / Coordinator |
| Python Agent | Python | 8101 |
A2A Endpoint |
| Go Agent | Go | 8102 |
A2A Endpoint |
| Node.js Agent | TypeScript | 8103 |
A2A / Express Endpoint |
| Rust Agent | Rust | 8104 |
A2A / Axum JSON-RPC Endpoint |
Run the initialization script to set up your Google Cloud Project ID and Gemini API Key:
./init.shSource the environment variables required for running the benchmarks:
source set_env.shYou can run each agent individually in separate terminals:
Runs the target Python prime calculation agent:
./bench-python.shRuns the Go benchmark agent:
./bench-go.shRuns the Node.js/TypeScript benchmark agent:
./bench-node.shRuns the Rust benchmark agent:
./bench-rust.shRuns the coordinator master agent that delegates tasks and benchmarks the other agents:
./bench-master.shTo quickly verify that the Rust agent is functional and responding to A2A requests:
./test-rust.shThe benchmark results can be plotted using:
python plot_primes.pyThis generates prime_calculation_times.png. Existing benchmarking comparison plots are saved as:
benchmark_performance.png(General comparison)benchmark_performance_15-20.png(Comparison for larger counts)