frameworks/Rust/hotaru/README.md
Hotaru is a lightweight, intuitive full-stack web framework for Rust that emphasizes simplicity and developer experience.
According to the TechEmpower Framework Benchmarks specification, this implementation includes all 7 required test types:
/json)GET /json{"message":"Hello, World!"}application/json/plaintext)GET /plaintextHello, World!text/plain/db)GET /db{"id": 123, "randomNumber": 456}application/json/queries)GET /queries?queries=Nqueries parameter clamped to 1-500/updates)GET /updates?queries=Nqueries parameter clamped to 1-500/cached-worlds)GET /cached-worlds?count=Ncount parameter clamped to 1-500/fortunes)GET /fortunestext/html; charset=utf-8cd frameworks/Rust/hotaru
cargo run --release
The server will start on http://0.0.0.0:8080
DATABASE_URL=postgres://benchmarkdbuser:benchmarkdbpass@localhost/hello_world
DB_POOL_SIZE=56 # Database connection pool size
# JSON serialization
curl http://localhost:8080/json
# Plaintext
curl http://localhost:8080/plaintext
# Single database query
curl http://localhost:8080/db
# Multiple queries (10 queries)
curl "http://localhost:8080/queries?queries=10"
# Updates (5 updates)
curl "http://localhost:8080/updates?queries=5"
# Cached queries (100 from cache)
curl "http://localhost:8080/cached-worlds?count=100"
# Fortunes (HTML)
curl http://localhost:8080/fortunes
Benchmark results on TechEmpower infrastructure (512 concurrent connections):
Average latency: 1.94-6.21ms under heavy load
Lazy<SApp>Arc<World> for efficient cache sharingAll responses include required TechEmpower headers:
Server: hotaruDate: <RFC 7231 timestamp>Content-Type headers-- World table (10,000 rows, IDs 1-10000)
CREATE TABLE World (
id integer NOT NULL,
randomNumber integer NOT NULL,
PRIMARY KEY (id)
);
-- Fortune table
CREATE TABLE Fortune (
id integer NOT NULL,
message varchar(2048) NOT NULL,
PRIMARY KEY (id)
);
frameworks/Rust/hotaru/
├── Cargo.toml # Dependencies and build config
├── README.md # This file
├── benchmark_config.json # TFB configuration
├── hotaru.dockerfile # Docker build instructions
├── setup.py # TFB setup script
├── src/
│ ├── main.rs # Hotaru server and endpoints
│ ├── database.rs # Database pool, cache, and queries
│ ├── models.rs # Data models (World, Fortune)
│ └── utils.rs # Helper functions
└── templates/
└── fortunes_hotaru.html # Fortune HTML template (Akari syntax)