{"slug": "revisiting-benchmarking-building-a-rust-a2a-agent", "title": "Revisiting Benchmarking- Building a Rust A2A Agent", "summary": "A developer built and benchmarked A2A protocol agents across Python, Go, Rust, and JavaScript, using the Antigravity CLI as an MCP client. The project measured the time each language spent running an algorithm inside its A2A agent, enabling cross-language performance comparison. The work revisits an earlier benchmark series, now adding Rust to the original set of Node, Go, and Python.", "body_md": "*This is a submission for the GitHub Finish-Up-A-Thon Challenge*\n\nThis tutorial aims to build and test benchmarking Agents using the A2A protocol across several popular programming languages. The Master Orchestrator Agent is exposed via MCP to allow Antigravity CLI to be used as a MCP client.\n\nThis paper is a re-visiting of the original benchmark series with Gemini CLI over Node, GO, and Python:\n\n**Cross Language A2A Agent Benchmarking with Gemini 3 and Gemini CLI**\n\n_Building a Benchmarking Agent with A2A and MCP_medium.com\n\nIn this updated version, the Antigravity CLI is used over Node, GO, Python, and Rust.\n\nMost mature Agent development tools and libraries are Python based. Python allows for rapid prototyping and evaluation of approaches. Python is also an interpreted language- which has trade-offs in memory safety, and performance. Other languages like GO and Rust offer high performance and memory safe operations. With a language neutral communication protocol — the actual Agent implementation of each Agent can be coded in the most appropriate language.\n\nThe high level goal was to measure the actual time spent running an algorithm in the native language code inside the A2A agent. Each language had a slightly different implementation due to the language syntax. After running the algorithm- each Agent was instructed to calculate and return the elapsed time for cross language comparison.\n\nThe Agent Development Kit (ADK) is a flexible and modular framework for **developing and deploying AI agents**. While optimized for Gemini and the Google ecosystem, ADK is **model-agnostic**, **deployment-agnostic**, and is built for **compatibility with other frameworks**. The official ADK is only currently available in the Python, GO, and Java programming languages.\n\nGoogle provides full documentation on the Agent Development Kit (ADK) here:\n\n**Agent Development Kit**\n\n_Build powerful multi-agent systems with Agent Development Kit_google.github.io\n\nThe Agent2Agent (A2A) protocol, an open communication standard for AI agents, was initially introduced by Google in April 2025. It is specifically engineered to facilitate seamless interoperability within multi-agent systems, enabling AI agents developed by diverse providers or built upon disparate AI agent frameworks to communicate and collaborate effectively.\n\nA good overview of the A2A protocol can be found here:\n\n**A2A Protocol**\n\n_The official documentation for the Agent2Agent (A2A) protocol. The A2A protocol is an open standard that allows…_a2a-protocol.org\n\nThe official ADK for Python, GO, and Java provide built-in support for working with the A2A protocol. For other programming languages like JS, Rust, and .NET — 3rd party libraries are available to add support for the protocol.\n\nThe main source for A2A Language support is the GitHub repo:\n\n**GitHub — a2aproject/A2A: An open protocol enabling communication and interoperability between…**\n\n_An open protocol enabling communication and interoperability between opaque agentic applications. — a2aproject/A2A_github.com\n\nThis article targets the Python, GO, Rust, and JavaScript environments.\n\nThe build tools for each language environment need to be in place. For building with Python- a working Python environment with 3.12 or later along with package management tools like uv or pip is required.\n\nFor building with GO — a recent version of the GO compiler (1.24.1 or later) is required.\n\nFor building with Rust, the Rust tool chain is required.\n\nFor building with Node / JavaScript — a working Node.js environment with Node version 20 or later and a functional npm tool is needed.\n\nAntigravity CLI is the follow-on successor to Gemini CLI- the terminal driven, agent assisted coding tool.\n\nFull details on installing Antigravity CLI are here:\n\n**Getting Started with Antigravity CLI**\n\n_This article covers the initial setup and configuration for the Antigravity CLI on a stock Linux Environment._medium.com\n\nOnce you have all the tools in place- you can test the startup of Antigravity CLI.\n\nYou will need to authenticate with a Google Cloud Project or your Google Account:\n\nagy\n\nThis will start the interface:\n\nVerify that all the prerequisite packages and compilers are installed — and clone the sample Github repo:\n\ngit clone [https://github.com/xbill9/a2a-benchmark](https://github.com/xbill9/a2a-benchmark)\n\ncd a2a-benchmark\n\nOnce you have your Google Cloud Project and preferred authentication method — run the **init.sh** script to validate the setup:\n\nxbill@penguin:~/a2a-benchmark$ source init.sh\n\nProject ID file found, skipping.\n\n--- Authentication Method ---\n\nDo you want to use a Gemini API Key for authentication? (y/n): n\n\nWARNING: Your active project does not match the quota project in your local Application Default Credentials file. This might result in unexpected quota issues.\n\nTo update your Application Default Credentials quota project, use the `gcloud auth application-default set-quota-project`\n\ncommand.\n\nUpdated property [core/project].\n\n--- Setup complete ---\n\nThe **set_env.sh** script is provided to set common ADK environment variables:\n\nxbill@penguin:~/a2a-benchmark$ source set_env.sh\n\n--- Setting Google Cloud Environment Variables ---\n\nChecking gcloud authentication status...\n\ngcloud is authenticated.\n\nExported PROJECT_ID=comglitn\n\nExported PROJECT_NUMBER=1056842563084\n\nExported SERVICE_ACCOUNT_NAME=[1056842563084-compute@developer.gserviceaccount.com](mailto:1056842563084-compute@developer.gserviceaccount.com)\n\nExported GOOGLE_CLOUD_PROJECT=comglitn\n\nExported GOOGLE_GENAI_USE_VERTEXAI=TRUE\n\nExported GOOGLE_CLOUD_LOCATION=us-central1\n\nExported REPO_NAME=\n\nExported REGION=us-central1\n\n--- Environment setup complete ---\n\nxbill@penguin:~/a2a-benchmark$\n\nIf your application default credentials expires or your Google Cloud Authentication expires you will get an error. The workaround is to re-authenticate:\n\ngcloud auth login\n\ngcloud auth application-default login\n\nAnother common error is that the environment variables are not set correctly. Go the the root directory and re-run the **set_env.sh** to set the variables:\n\ncd ~/adk-hello-world-a2a\n\nsource set_env.sh\n\nThe A2A Inspector is a standalone tool that provides low level visibility into the A2A protocol. The GitHub is available here:\n\n**GitHub — a2aproject/a2a-inspector: Validation Tools for A2A Agents**\n\n_Validation Tools for A2A Agents. Contribute to a2aproject/a2a-inspector development by creating an account on GitHub._github.com\n\nA summary of the features of the A2A inspector can be found here:\n\n**A2A Protocol Documentation**\n\n_Documentation for A2A Protocol_a2aprotocol.ai\n\nTo install the A2A Inspector:\n\ncd ~\n\ngit clone [https://github.com/a2aproject/a2a-inspector](https://github.com/a2aproject/a2a-inspector)\n\nThen follow the build instructions — you need ** uv**, and a recent version of\n\n**a2a-inspector/README.md at main · a2aproject/a2a-inspector**\n\n_Validation Tools for A2A Agents. Contribute to a2aproject/a2a-inspector development by creating an account on GitHub._github.com\n\nOnce the A2A inspector has been installed- you can validate the installation by using this URL:\n\nThe ADK provides several key tools to allow standard ADK Agents to run as standalone A2A agents — without the ADK — either in A2A Client or A2A Server mode. The Python ADK includes libraries and samples to extend a standard ADK agent to enable A2A protocol features. Instead of running the agent inside the ADK web utility- the agents are dual purposed with A2A to be able to run as dedicated agents with their own embedded Uvicorn web server.\n\nWhen Agents are run in ADK mode — the ADK CLI or Web interface is used to directly interact with the Agents. The ADK UI is started in a well known port — usually 8000 and the Agents are accessed in that environment.\n\nThe ADK does not automatically expose the agent as an A2A agent. The basic agent code from the ADK needs to be extended and enabled to run as a standalone A2A Agent. Without the additional A2A function calls and a active standalone web server- the Agents will not be usable in A2A mode.\n\nIn [mathematics](https://en.wikipedia.org/wiki/Mathematics), a **Mersenne prime** is a [prime number](https://en.wikipedia.org/wiki/Prime_number) that is one less than a [power of two](https://en.wikipedia.org/wiki/Power_of_two). As of 2025, [52 Mersenne primes](https://en.wikipedia.org/wiki/List_of_Mersenne_primes_and_perfect_numbers) are known. An interesting thing about Mersenne primes is that they are the easiest natural numbers to prove to be primes, so they make up the largest category on the list of known prime numbers. This example was chosen as a good problem as the computation is CPU bound and gets exponentially longer for each higher number.\n\nThe a2a_benchmark Repo has sample scripts for running the ADK and various types of agents across programming languages. Each agent implements a Mersenne Prime Number generator with only basic optimization. The root directory of the a2a-benchmark directory contains several common agent development languages. These include:\n\nThis agent provides a basic Agent that generates Mersenne prime numbers. To run the agent — run the **bench-go.sh** script:\n\nRunning the Go project...\n\n{\"time\":\"2025-11-25T13:47:18.071713651-05:00\",\"level\":\"INFO\",\"msg\":\"Using Model \",\"model\":\"gemini-2.5-flash\"}\n\n{\"time\":\"2025-11-25T13:47:18.07195886-05:00\",\"level\":\"INFO\",\"msg\":\"Starting A2A mersenne prime server\",\"port\":\"8102\"}\n\n{\"time\":\"2025-11-25T13:47:18.072116547-05:00\",\"level\":\"INFO\",\"msg\":\"Starting the web server: &{port:8102 writeTimeout:15000000000 readTimeout:15000000000 idleTimeout:60000000000}\"}\n\n{\"time\":\"2025-11-25T13:47:18.072119644-05:00\",\"level\":\"INFO\",\"msg\":\"\"}\n\n{\"time\":\"2025-11-25T13:47:18.072121732-05:00\",\"level\":\"INFO\",\"msg\":\"Web servers starts on [http://localhost:8102\"](http://localhost:8102%22)}\n\n{\"time\":\"2025-11-25T13:47:18.072123829-05:00\",\"level\":\"INFO\",\"msg\":\" a2a: you can access A2A using jsonrpc protocol: [http://localhost:8102\"](http://localhost:8102%22)}\n\n{\"time\":\"2025-11-25T13:47:18.072125402-05:00\",\"level\":\"INFO\",\"msg\":\"\"}\n\nThe A2A inspector can be used to validate the Agent:\n\n\"id\": \"adk-88a8aefa-3070-48ff-b8d1-631af65ea57e\",\n\n\"name\": \"generate_primes\",\n\n\"response\": {\n\n\"result\": \"Elapsed time: 307.932µs\"\n\n}\n\nThis agent provides Python agent that implements the Mersenne generation algorithm.\n\nThis Agent can be checked with the ADK web interface:\n\nwhat do you do\n\nI can calculate Mersenne primes using the Lucas-Lehmer primality test. I can find the list of the first N Mersenne primes.\n\nfind the first 10 primes\n\nIt took 0.0002677440643310547 seconds to find the first 10 Mersenne primes.\n\nTo start the dedicated A2A version of the Python prime number generator Agent use the **bench-python.sh** script:\n\nxbill@penguin:~/a2a-benchmark$ source bench-python.sh\n\nINFO: Started server process [10495]\n\nINFO: Waiting for application startup.\n\nINFO: Application startup complete.\n\nINFO: Uvicorn running on [http://0.0.0.0:8101](http://0.0.0.0:8101) (Press CTRL+C to quit)\n\nThis agent provides a minimal agent to generate a prime number. To run the Agent use the **bench-node.sh** script:\n\n/home/xbill/a2a-benchmark/benchmark-node\n\nstaring a2a bench node generate prime\n\nThe Agent can be validated with the A2A inspector on port 8103:\n\nA typical session will look something like this:\n\nwhat do you do\n\nmessage\n\nFound first 5 Mersenne primes in 0.09ms.\n\n✅\n\nfind 10 primes\n\nmessage\n\nFound first 10 Mersenne primes in 0.81ms.\n\n✅\n\nThe Mersenne primes algorithm was newly implemented in Rust:\n\nA sample test script verified the A2A Agent skill:\n\nxbill@penguin:~/a2a-benchmark$ source test-rust.sh\n\nChecking if Rust A2A agent is running on port 8104...\n\nRust agent is already running.\n\nRunning Test 1: Fetching Agent Card...\n\nAgent Card Response:\n\n{\n\n\"name\": \"Mersenne Prime Agent Rust\",\n\n\"description\": \"A rust agent that builds a list of the first n Mersenne primes and reports the elapsed time. Configured with model: Not specified.\",\n\n\"protocolVersion\": \"0.3.0\",\n\n\"version\": \"0.1.0\",\n\n\"url\": \"[http://0.0.0.0:8104/](http://0.0.0.0:8104/)\",\n\n\"skills\": [\n\n{\n\n\"id\": \"find-mersenne-rust\",\n\n\"name\": \"Find Mersenne Primes in rust\",\n\n\"description\": \"Finds the list of the first n Mersenne primes in Rust\",\n\n\"tags\": [\n\n\"math\",\n\n\"benchmark\"\n\n]\n\n}\n\n],\n\n\"capabilities\": {},\n\n\"defaultInputModes\": [],\n\n\"defaultOutputModes\": []\n\n}\n\n✅ Test 1 Passed: Agent Card is valid.\n\nRunning Test 2: Sending message/send request to calculate 5 Mersenne primes...\n\nResponse:\n\n{\n\n\"id\": 1,\n\n\"jsonrpc\": \"2.0\",\n\n\"result\": {\n\n\"contextId\": \"test-context-123\",\n\n\"kind\": \"message\",\n\n\"messageId\": \"f20c704c-bafa-4081-a18d-8d7984d4213c\",\n\n\"parts\": [\n\n{\n\n\"kind\": \"text\",\n\n\"text\": \"Found first 5 Mersenne primes in 0.11ms.\"\n\n}\n\n],\n\n\"role\": \"agent\"\n\n}\n\n}\n\n✅ Test 2 Passed: Successfully calculated primes.\n\nRunning Test 3: Sending invalid RPC method...\n\nError Response:\n\n{\n\n\"error\": {\n\n\"code\": -32601,\n\n\"message\": \"Method not found: invalid/method\"\n\n},\n\n\"id\": 2,\n\n\"jsonrpc\": \"2.0\"\n\n}\n\n✅ Test 3 Passed: Invalid method was rejected successfully.\n\nAll tests passed successfully!\n\nThe final agent follows a slightly different pattern. It provides a minimal agent with several functions (Tools/Skills). It has one *root_agent* and 3 remote agents connected over A2A. This agent also exposes an interface as a MCP server- allowing Antigravity CLI to be used as a MCP client.\n\nThe Master Agent is started with a similar script:\n\n╭──────────────────────────────────────────────────────────────────────────────╮\n\n│ │\n\n│ ▄▀▀ ▄▀█ █▀▀ ▀█▀ █▀▄▀█ █▀▀ █▀█ │\n\n│ █▀ █▀█ ▄▄█ █ █ ▀ █ █▄▄ █▀▀ │\n\n│ │\n\n│ FastMCP 2.13.1 │\n\n│ │\n\n│ │\n\n│ 🖥 Server name: benchmark │\n\n│ │\n\n│ 📦 Transport: HTTP │\n\n│ 🔗 Server URL: [http://127.0.0.1:8100/mcp](http://127.0.0.1:8100/mcp) │\n\n│ │\n\n│ 📚 Docs: [https://gofastmcp.com](https://gofastmcp.com) │\n\n│ 🚀 Hosting: [https://fastmcp.cloud](https://fastmcp.cloud) │\n\n│ │\n\n╰──────────────────────────────────────────────────────────────────────────────╯\n\n[11/25/25 14:17:36] INFO Starting MCP server 'benchmark' with transport 'http' on [http://127.0.0.1:8100/mcp](http://127.0.0.1:8100/mcp) server.py:2055\n\nINFO: Started server process [21826]\n\nINFO: Waiting for application startup.\n\nINFO: Application startup complete.\n\nINFO: Uvicorn running on [http://127.0.0.1:8100](http://127.0.0.1:8100) (Press CTRL+C to quit)\n\nThe Master Agent starts a FastMCP server interface. This allows Antigravity CLI to be used as a MCP client:\n\nxbill@penguin:~/a2a-benchmark/.agents$ more mcp_config.json\n\n{\n\n\"mcpServers\": {\n\n\"bench\": {\n\n\"serverUrl\": \"[http://127.0.0.1:8100/mcp](http://127.0.0.1:8100/mcp)\",\n\n\"serverURL\": \"[http://127.0.0.1:8100/mcp](http://127.0.0.1:8100/mcp)\"\n\n}\n\n}\n\n}\n\nBecause it is Python based- the Master Agent can also be viewed with the ADK web interface:\n\nAll of the setup and configuration allows you to start debugging and visualizing Agent flows using the A2A protocol. The Agents can be validated using the A2A Inspector. The Python Agents can be checked with the ADK web interfaces. The Master Agent can be validated with Antigravity CLI as a MCP client.\n\nNow that the individual Agents have been validated — open several Terminal windows and start up all the remaining agents:\n\nOnce all the agents have been started — the Master agent on port 8100 is connected over MCP with Antigravity CLI:\n\nI have completed the benchmark run across all four language agents for primes 1 to 22.\n\n### Summary of Actions Taken:\n\nPlease view analysis_results.md to inspect the table and embedded plots showing the comparison of calculation speeds\n\nand\n\nlatency characteristics!\n\nThe results of the benchmark are graphed:\n\nWith latency times:\n\nAntigravity CLI summarized the results of the Agent Benchmarking:\n\nFormulating Key Findings\n\nHere is a summary of the key findings from the benchmark results for primes 1 to 22:\n\n### 1. Core Computation Performance (Lucas-Lehmer Prime Calculation)\n\n• Rust is the fastest: Computes $N=22$ in 195.96 ms.\n\n• Node.js (TS) is extremely close: Computes $N=22$ in 214.06 ms.\n\n• Go performs well: Computes $N=22$ in 279.54 ms.\n\n• Python is the slowest: Computes $N=22$ in 572.48 ms (roughly 3x slower than Rust).\n\n### 2. A2A Framework & Protocol Overhead\n\n• Minimal Overhead (Rust & Node.js):\n\n• Rust and Node.js use lightweight custom HTTP wrappers. Their framework overhead is practically negligible (< 2\n\nms). For example, Node's total round-trip time (RTT) for $N=22$ is 215.78 ms (only 1.72 ms higher than the raw\n\ncalculation time).\n\n• Significant Base Overhead (Go & Python):\n\n• Both Go and Python use the official google-adk library. This introduces a fixed baseline overhead per request\n\n(schema validation, logging, and metadata context processing).\n\n• Go incurs a consistent baseline RTT of ~1.2s to 1.6s.\n\n• Python incurs a consistent baseline RTT of ~2.3s to 3.0s.\n\nand a deeper dive:\n\nAnalyzing Agent Initialization\n\nBased on an analysis of the codebase and execution paths, here is the breakdown of why the benchmark produced these\n\nresults:\n\n──────\n\n### Factor 1: The Massive Latency (RTT) Difference (Framework vs. Mocking)\n\nThe most striking difference is that Rust and Node.js have near-zero overhead, whereas Go takes ~1.5s and Python\n\ntakes\n\n~2.5s. This is entirely due to how the agents process the benchmark messages:\n\n──────\n\n### Factor 2: Mathematical Computation Speeds (Lucas-Lehmer Loop)\n\nAt higher values (e.g., $N=22$, where the Mersenne number $2^{9941}-1$ has 2,993 decimal digits and the Lucas-Lehmer\n\ntest requires 9,939 iterations of squaring and modular reductions), we see clear performance tiers:\n\nFor low numbers of Mersenne primes that execute quickly- all four languages are comparable. An unusual result was the good performance in the mid range from Node. This could have been from lower overhead of the Node A2A toolkit or potentially from JavaScript engine optimizations. As expected, GO and Rust did break out and delivered the best performance as the complexity scaled.\n\nThe goal of the demo/article was to get basic Agents implemented across multiple programming languages and benchmark the Agent performance finding Mersenne primes.\n\nThe Google Agent development kit (ADK) was presented along with the complimentary A2A (Agent to Agent) protocol. Three basic agents were presented — covering various combinations of programming languages and Agent implementation approaches.\n\nFinally — a Master/Orchestrator agent was started to connect and delegate to the other agents via the A2A protocol. Antigravity CLI was used to connect to the Master Agent over MCP and execute the benchmarks.### Cross Language A2A Agent Benchmarking with Gemini 3 and Antigravity CLI", "url": "https://wpnews.pro/news/revisiting-benchmarking-building-a-rust-a2a-agent", "canonical_source": "https://dev.to/gde/revisiting-benchmarking-building-a-rust-a2a-agent-5bl2", "published_at": "2026-05-27 02:55:27+00:00", "updated_at": "2026-05-27 03:23:12.283164+00:00", "lang": "en", "topics": ["ai-agents", "artificial-intelligence", "ai-tools", "ai-infrastructure"], "entities": ["A2A", "MCP", "Antigravity CLI", "Gemini CLI", "Gemini 3", "Node", "GO", "Rust"], "alternates": {"html": "https://wpnews.pro/news/revisiting-benchmarking-building-a-rust-a2a-agent", "markdown": "https://wpnews.pro/news/revisiting-benchmarking-building-a-rust-a2a-agent.md", "text": "https://wpnews.pro/news/revisiting-benchmarking-building-a-rust-a2a-agent.txt", "jsonld": "https://wpnews.pro/news/revisiting-benchmarking-building-a-rust-a2a-agent.jsonld"}}