Vix is a next-generation offline-first, peer-to-peer, ultra-fast runtime for modern C++.
Its goal is clear:
A runtime capable of running apps like Node / Deno / Bun —
but engineered for unstable, low-quality, real-world networks.
Vix is more than a backend framework:
it is a modular runtime, designed for distributed applications, edge systems, offline devices, and environments where traditional cloud frameworks fail.
Inspired by FastAPI, Vue.js, React, and modern runtimes — but rebuilt from scratch in C++20 for raw speed and full control.
All benchmarks were executed using wrk
8 threads, 800 connections, for 30 seconds, on the same machine:
Ubuntu 24.04 — Intel Xeon — C++20 optimized build — Logging disabled
Results represent steady-state throughput on a simple "OK" endpoint.
| Framework | Requests/sec | Avg Latency | Transfer/sec |
|---|---|---|---|
| ⭐ Vix.cpp (v1.12.3) | ~98,942 (pinned CPU) | 7.3–10.8 ms | ~13.8 MB/s |
| Vix.cpp (default run) | 81,300 – 81,400 | 9.7–10.8 ms | ≈ 11.3 MB/s |
| Go (Fiber) | 81,336 | 0.67 ms | 10.16 MB/s |
| Deno | ~48,868 | 16.34 ms | ~6.99 MB/s |
| Node.js (Fastify) | 4,220 | 16.00 ms | 0.97 MB/s |
| PHP (Slim) | 2,804 | 16.87 ms | 0.49 MB/s |
| Crow (C++) | 1,149 | 41.60 ms | 0.35 MB/s |
| FastAPI (Python) | 752 | 63.71 ms | 0.11 MB/s |
🔥 New record: When pinned to a single core (
taskset -c 2)
Vix.cpp reaches ~99k req/s, surpassing Go and matching the fastest C++ microframeworks.
- zero-cost abstractions
- custom ThreadPool tuned for HTTP workloads
- optimized HTTP pipeline
- fast-path routing
- Beast-based IO
- minimal memory allocations
- predictable threading model
When benchmarking from inside the Vix.cpp repository (using the built-in example):
cd ~/vixcpp/vix
export VIX_LOG_LEVEL=critical
export VIX_LOG_ASYNC=false
# Run the optimized example server
vix run example mainThen, in another terminal:
wrk -t8 -c800 -d30s --latency http://127.0.0.1:8080/benchIf you want CPU pinning for more stable results:
taskset -c 2 ./build/main
wrk -t8 -c800 -d30s --latency http://127.0.0.1:8080/bench✔ Fast-path routing gives +1–3%
Use /fastbench to bypass RequestHandler overhead.
#include <vix.hpp>
using namespace Vix;
int main() {
App app;
app.get("/", [](Request, Request res) {
res.json({ "message", "Hello world" });
});
app.run(8080);
}app.get("/users/{id}", [](Request req, Response res) {
auto id = req.param("id");
return json::o("user_id", id);
});This example shows the smallest fully working HTTP + WS hybrid server.
- Basic GET route
- Simple WS connection handling
- Auto-start server
#include <vix.hpp>
#include <vix/websocket/AttachedRuntime.hpp>
using namespace vix;
int main()
{
auto bundle = vix::make_http_and_ws("config/config.json");
auto &[app, ws] = bundle;
app.get("/", [](const Request &, Response &res)
{ res.json({"framework", "Vix.cpp",
"message", "HTTP + WebSocket example (basic) 🚀"}); });
ws.on_open([&ws](auto &session)
{
(void)session;
ws.broadcast_json("chat.system", {
"user", "server",
"text", "Welcome to Vix WebSocket! 👋"
}); });
vix::run_http_and_ws(app, ws, 8080);
return 0;
}auto client = Client::create("localhost", "9090", "/");
client->on_open([] {
std::cout << "Connected!" << std::endl;
});
client->send("chat.message", {"text", "Hello world!"});Cloud-first frameworks assume:
- stable networks
- predictable latency
- always-online connectivity
But in most of the world, this is not reality.
Vix is built for:
Applications continue functioning even without internet.
Nodes sync and communicate locally without a central server.
C++20 + Asio + zero-overhead abstractions.
- Offline-first runtime architecture
- Peer-to-peer–ready communication model
- Asynchronous HTTP server
- Expressive and composable routing
- ORM support for MySQL and SQLite
- Middleware system
- WebSocket engine
- Modular architecture
- Developer experience comparable to Node.js, Deno, and Bun
- High-performance runtime (80k+ requests/sec)
To build Vix.cpp from source:
git clone https://github.com/vixcpp/vix.git
cd vix
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -jThis builds the Vix runtime and CLI.
Make sure the resultingvixbinary is available in yourPATH.
Create and run a new Vix project using the CLI:
vix new myapp
cd myapp
vix build
vix runCommon development commands:
vix dev # watch, rebuild, reload
vix run # build (if needed) and run
vix check # validate project or compile a single .cpp (no execution)
vix tests # run project tests
vix orm migrate # run ORM migrationsVix can execute a single .cpp file like a script, without creating a full project.
vix run main.cpp # run once
vix dev main.cpp # run + watch (hot reload)Runs the file once, then exits.
~/dev/scripts$ vix run main.cpp
Hello, worldRuns the file in watch mode.
Vix recompiles and restarts automatically when the file changes.
~/dev/scripts$ vix dev main.cpp
Starting Vix dev mode.
➜ Tip: use `Ctrl+C` to stop dev mode; edit your files and Vix will rebuild & restart automatically.
Watcher Process started (hot reload).
➜ Watching: /home/softadastra/dev/scripts/main.cpp
🏃 Script started (pid=125953)
Hello, worldWhen running a .cpp file directly, Vix:
- Creates a temporary build directory under:
./.vix-scripts/<filename>/ - Generates a minimal CMake project internally
- Compiles the file as a standalone executable
- Runs it immediately
- In
devmode:- Watches the source file
- Rebuilds and restarts automatically on changes
- Stops cleanly on
Ctrl+C(no noisy build output)
| Command | Behavior |
|---|---|
vix run main.cpp |
Compile → run once |
vix dev main.cpp |
Compile → run → watch & hot-reload |
- Introduction
- Quick Start
- Architecture & Modules
- ORM Overview
- Benchmarks
- Examples
- Build & Installation
- CLI Options
- CLI Reference
- Core Module — docs/modules/core.md
- WebSocket Module — docs/modules/websocket.md
- ORM Module — docs/modules/orm.md
- JSON Module — docs/modules/json.md
- Utils Module — docs/modules/utils.md
- CLI Module — docs/modules/cli.md
Vix.cpp sits at the top of modern backend runtimes, matching or exceeding high-performance frameworks like Go Fiber, and outperforming Deno, Node, PHP, Python, and even several C++ frameworks like Crow.
Vix.cpp = the C++ runtime pushing boundaries.
Contributions are welcome!
Please read the contributing guidelines.
Licensed under the MIT License.