# retr0-flow/async-benchmark architecture

> Architecture diagram of the GitHub repository retr0-flow/async-benchmark, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/retr0-flow/async-benchmark
- Repository: https://github.com/retr0-flow/async-benchmark

## Overview

This is a single-file HTTP-client benchmarking script. Its active workflow runs aiohttp and httpx async request batches under both asyncio and uvloop, collects timings, and prints a comparison table. A synchronous requests/urllib3/httpx benchmark also exists, but its invocation is commented out. The README is empty, so capabilities and relationships here are based on main.py; the graph omits the unrelated coroutine demo.

Main entry points: [`main.py`](https://github.com/retr0-flow/async-benchmark/blob/main/main.py) (Benchmark entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runner["Benchmark orchestration"]
  node_entry["Benchmark entry<br/>[main.py]"]
  node_asyncio["Asyncio runtime"]
  node_uvloop["Uvloop runtime"]
  node_async_suite["Async suite<br/>[main.py]"]
end

subgraph group_clients["HTTP clients"]
  node_aiohttp_run["Aiohttp benchmark<br/>[main.py]"]
  node_httpx_run["Httpx benchmark<br/>[main.py]"]
  node_sync_suite["Sync benchmark<br/>[main.py]"]
end

subgraph group_output["Results and reporting"]
  node_results["Timing results<br/>[main.py]"]
  node_printer["Results formatter<br/>[main.py]"]
end

node_user(("Script operator"))
node_echo["Postman Echo"]

node_user -->|"runs script"| node_entry
node_entry -->|"runs suite"| node_asyncio
node_entry -->|"runs suite"| node_uvloop
node_asyncio -->|"dispatches"| node_async_suite
node_uvloop -->|"dispatches"| node_async_suite
node_async_suite -->|"awaits"| node_aiohttp_run
node_async_suite -->|"awaits"| node_httpx_run
node_aiohttp_run -->|"requests"| node_echo
node_httpx_run -->|"requests"| node_echo
node_async_suite -->|"appends timings"| node_results
node_entry -->|"groups runs"| node_results
node_entry -->|"prints results"| node_printer
node_printer -->|"formats"| node_results
node_sync_suite -->|"requests"| node_echo

click node_entry "https://github.com/retr0-flow/async-benchmark/blob/main/main.py"
click node_async_suite "https://github.com/retr0-flow/async-benchmark/blob/main/main.py"
click node_aiohttp_run "https://github.com/retr0-flow/async-benchmark/blob/main/main.py"
click node_httpx_run "https://github.com/retr0-flow/async-benchmark/blob/main/main.py"
click node_sync_suite "https://github.com/retr0-flow/async-benchmark/blob/main/main.py"
click node_results "https://github.com/retr0-flow/async-benchmark/blob/main/main.py"
click node_printer "https://github.com/retr0-flow/async-benchmark/blob/main/main.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_entry,node_asyncio,node_uvloop,node_async_suite toneBlue
class node_aiohttp_run,node_httpx_run,node_sync_suite toneAmber
class node_results,node_printer toneMint
class node_user,node_echo toneIndigo
```

## Components

### Benchmark orchestration

- [Benchmark entry](https://github.com/retr0-flow/async-benchmark/blob/main/main.py): `main.py`
- **Asyncio runtime**
- **Uvloop runtime**
- [Async suite](https://github.com/retr0-flow/async-benchmark/blob/main/main.py): `main.py`

### HTTP clients

- [Aiohttp benchmark](https://github.com/retr0-flow/async-benchmark/blob/main/main.py): `main.py`
- [Httpx benchmark](https://github.com/retr0-flow/async-benchmark/blob/main/main.py): `main.py`
- [Sync benchmark](https://github.com/retr0-flow/async-benchmark/blob/main/main.py): `main.py`

### Results and reporting

- [Timing results](https://github.com/retr0-flow/async-benchmark/blob/main/main.py): `main.py`
- [Results formatter](https://github.com/retr0-flow/async-benchmark/blob/main/main.py): `main.py`

### Other components

- **Script operator**
- **Postman Echo**

## Connections

- Script operator → Benchmark entry: runs script (evidence: `main.py`)
- Benchmark entry → Asyncio runtime: runs suite (evidence: `main.py`)
- Benchmark entry → Uvloop runtime: runs suite (evidence: `main.py`)
- Asyncio runtime → Async suite: dispatches (evidence: `main.py`)
- Uvloop runtime → Async suite: dispatches (evidence: `main.py`)
- Async suite → Aiohttp benchmark: awaits (evidence: `main.py`)
- Async suite → Httpx benchmark: awaits (evidence: `main.py`)
- Aiohttp benchmark → Postman Echo: requests (evidence: `main.py`)
- Httpx benchmark → Postman Echo: requests (evidence: `main.py`)
- Async suite → Timing results: appends timings (evidence: `main.py`)
- Benchmark entry → Timing results: groups runs (evidence: `main.py`)
- Benchmark entry → Results formatter: prints results (evidence: `main.py`)
- Results formatter → Timing results: formats (evidence: `main.py`)
- Sync benchmark → Postman Echo: requests (evidence: `main.py`)
