{"id":47755771,"url":"https://github.com/nogcio/web-framework-benchmark","last_synced_at":"2026-04-03T04:17:43.600Z","repository":{"id":329575079,"uuid":"1120031911","full_name":"nogcio/web-framework-benchmark","owner":"nogcio","description":"Automated benchmarking infrastructure for comparing web framework performance (throughput, latency).","archived":false,"fork":false,"pushed_at":"2026-01-24T08:12:18.000Z","size":13451,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-24T18:56:38.706Z","etag":null,"topics":["bench","comparison-latency","perf","rust","throughput","web-fra"],"latest_commit_sha":null,"homepage":"https://wfb.nogc.io","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nogcio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-20T10:45:36.000Z","updated_at":"2026-01-24T08:12:05.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/nogcio/web-framework-benchmark","commit_stats":null,"previous_names":["nogcio/web-framework-benchmark"],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/nogcio/web-framework-benchmark","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nogcio%2Fweb-framework-benchmark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nogcio%2Fweb-framework-benchmark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nogcio%2Fweb-framework-benchmark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nogcio%2Fweb-framework-benchmark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nogcio","download_url":"https://codeload.github.com/nogcio/web-framework-benchmark/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nogcio%2Fweb-framework-benchmark/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31333234,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-03T03:20:36.090Z","status":"ssl_error","status_checked_at":"2026-04-03T03:20:35.133Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bench","comparison-latency","perf","rust","throughput","web-fra"],"created_at":"2026-04-03T04:17:42.850Z","updated_at":"2026-04-03T04:17:43.595Z","avatar_url":"https://github.com/nogcio.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n  \u003cimg src=\"assets/logo.svg\" alt=\"Web Framework Benchmark Logo\" width=\"120\" /\u003e\n\n  # Web Framework Benchmark\n\n  **An open, reproducible benchmark suite for comparing web framework performance across languages.**\n  \n  [![Rust](https://img.shields.io/badge/built_with-Rust-dca282.svg?logo=rust)](https://www.rust-lang.org/)\n  [![Docker](https://img.shields.io/badge/container-Docker-2496ED.svg?logo=docker)](https://www.docker.com/)\n  [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)\n\n  [Features](#features) • [Methodology](docs/METHODOLOGY.md) • [FAQ](docs/FAQ.md) • [Architecture](#architecture) • [Quick Start](#quick-start) • [Adding Benchmarks](docs/GUIDE_ADDING_BENCHMARKS.md) • [Contributing](#contributing)\n\n  \u003cbr /\u003e\n\n  \u003cimg src=\"assets/preview.png\" alt=\"Web Framework Benchmark Preview\" width=\"100%\" /\u003e\n\n\u003c/div\u003e\n\n\u003cbr /\u003e\n\n## 🚀 Philosophy: Benchmarking Reality\n\nMost web benchmarks focus on synthetic \"Hello World\" cases that measure raw socket performance but ignore application logic. **Web Framework Benchmark (WFB)** takes a different approach.\n\nWe measure how frameworks handle **real-world production scenarios**, prioritizing application complexity, strict correctness, and modern protocol comparisons over simple echo tests.\n\n## 🏆 Key Differentiators\n\n### 1. 🧠 Heavy Business Logic\nWe don't just dump bytes to a socket.\n- **JSON Analytics**: Simulates a microservice analyzing e-commerce orders. It tests parsing efficiency, in-memory aggregation, and allocation-heavy workloads.\n- **Database Complex**: A full \"User Profile\" endpoint mixing reads, writes, and parallel queries to build complex nested responses.\n\n### 2. ⚔️ HTTP vs. gRPC\nModern architectures often choose between REST and gRPC. WFB offers mirrored specifications (e.g., `JSON Aggregate` vs `gRPC Aggregate`) to provide a definitive answer on overhead and performance differences for the exact same logic.\n\n### 3. 🛡️ Strict Validation\nSpeed is meaningless if the data is wrong.\nOur load generator ([nogcio/wrkr](https://github.com/nogcio/wrkr) via Docker) validates every single response. If a framework returns an incorrect sum in an analytics report or misses a field in a JSON object, the test fails. No caching shortcuts allowed.\n\n### 4. 🛠️ Developer Experience\nRunning benchmarks shouldn't require complex ops.\nWFB is a self-contained **Rust** workspace. The single CLI tool manages Docker composition, database lifecycles, and reporting.\n\n## 🔬 Methodology \u0026 Fairness\n\nWe believe benchmarks should be transparent and reproducible.\n\n- **Warmup Phase**: Every test includes a **30-second warmup** to allow JIT compilers (Java, C#, JS, Lua) to optimize hot paths before measurement begins.\n- **Ramping VUs**: We ramp up to a configured max concurrency (VUs) to show scaling behaviour rather than picking a single \"magic number\".\n- **Realistic Client**: Load is driven by [nogcio/wrkr](https://github.com/nogcio/wrkr) running in Docker, executing Lua scenarios under `scripts/`.\n- **Latency Distribution**: We capture high-resolution latency histograms (p50, p90, p99, max) to identify \"hiccups\" caused by GC pauses or improper async blocking.\n\n## 🧪 Test Suite\n\n| Test Suite | Focus | Real-World Analogy |\n|------------|-------|--------------------|\n| **[Plaintext](docs/specs/plaintext_spec.md)** | Baseline Throughput | Load Balancers, Gateways |\n| **[JSON Analytics](docs/specs/json_aggregate_spec.md)** | CPU \u0026 Memory efficiency | Data Processing Microservices |\n| **[Database Complex](docs/specs/db_complex_spec.md)** | ORM overhead, Async flows | User Dashboards, CMS |\n| **[gRPC Aggregate](docs/specs/grpc_aggregate_spec.md)** | Protocol Efficiency | Inter-service Communication |\n| **[Static Files](docs/specs/static_files_spec.md)** | Network I / O, Sendfile | CDNs, Asset Servers |\n\n## 🏗 Architecture\n\nThe project is organized as a Rust workspace:\n\n1.  **wfb-runner**: The CLI tool that orchestrates Docker containers and runs benchmarks.\n2.  **wfb-server**: The API server that provides access to benchmark data.\n3.  **wfb-storage**: Shared library for configuration, storage logic, and data models.\n4.  **Load generator**: [nogcio/wrkr](https://github.com/nogcio/wrkr) (Docker image) + WFB Lua scripts under `scripts/`.\n\n## 🏁 Quick Start\n\n### Prerequisites\n\n- **Rust** (2024 edition)\n- **Docker** (Running)\n- **Node.js** (required to build `wfb-server` UI assets via `npx` Tailwind/esbuild; optional if you provide `TAILWINDCSS_BIN`/`ESBUILD_BIN` or have `tailwindcss`/`esbuild` available on `PATH`)\n\n### 1. Build the Components\n\n```bash\ngit clone https://github.com/nogcio/web-framework-benchmark.git\ncd web-framework-benchmark\ncargo build --release\n```\n\n### 2. Run a Benchmark\n\nExecute the configured benchmarks using the runner.\n\n```bash\n# Run the entire suite with Run ID \"1\"\ncargo run --release --bin wfb-runner -- run 1 --env local\n\n# OR run a single benchmark for development/testing\ncargo run --release --bin wfb-runner -- dev \u003cbenchmark_name\u003e --env local\n```\n\n### 3. Launch the Dashboard\n\nStart the API server to browse results in an interactive dashboard.\n\n```bash\ncargo run --release --bin wfb-server\n# Open http://localhost:8080 in your browser\n```\n\n## 🌐 Public Deployment (Security)\n\nIf you run WFB as a public website, enable the production security headers and configure CORS explicitly.\n\n- Enable strict browser headers (recommended for public):\n  - `WFB_PUBLIC=1`\n  - Adds `Content-Security-Policy` (nonce-based), `Strict-Transport-Security` (HSTS), and `Cross-Origin-Resource-Policy`.\n- Roll out CSP safely first:\n  - `WFB_CSP_REPORT_ONLY=1` (uses `Content-Security-Policy-Report-Only`)\n  - Remove it once you are confident.\n- Configure API CORS only if you actually need cross-origin API usage:\n  - `WFB_CORS_ALLOW_ORIGINS=\"https://your-domain.example,https://other.example\"`\n  - `WFB_CORS_ALLOW_ORIGINS=\"*\"` is supported but not recommended for a public production site.\n\nNotes:\n\n- `WFB_PUBLIC=1` is intended for HTTPS deployments (it enables `upgrade-insecure-requests`).\n- HSTS only has effect when served over HTTPS (typically behind a reverse proxy). If you run behind a proxy, either:\n  - configure HSTS at the proxy, or\n  - ensure it forwards `X-Forwarded-Proto: https` (or `Forwarded: proto=https`) so the app can safely emit HSTS.\n- If you add new inline `\u003cscript\u003e` tags in templates, they must be nonce-gated to satisfy CSP.\n\n## 🤝 Contributing\n\nWe welcome contributions! The project is community-driven, and **anyone can add a new framework benchmark via a Pull Request**.\n\nIf you want to add your favorite framework:\n1.  Read the [Adding a New Benchmark](docs/GUIDE_ADDING_BENCHMARKS.md) guide.\n2.  Implement the benchmark following the specs.\n3.  Submit a PR!\n\nWhether it's adding a new framework or fixing bugs, we appreciate your help. Please check out [CONTRIBUTING.md](CONTRIBUTING.md) for general guidelines.\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnogcio%2Fweb-framework-benchmark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnogcio%2Fweb-framework-benchmark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnogcio%2Fweb-framework-benchmark/lists"}