Implementation
Loco
Loco 1.3.1 · Rust · Rust · ranked
Scores
| Category | Position | Score | ± |
|---|---|---|---|
| Hello world | 3–7 | 0.49* | ±14.9% |
| Database | 3–7 | 0.84* | ±13.3% |
| Application | 4 | 0.83* | ±4.3% |
| Memory (high-water mark) | 1–5 | 1.00≈ | ±0.4% |
| Startup | 1–13 | 1.00≈ | ±0.0% |
Runner CPUs: Xeon 6975P-C, EPYC 9V74, EPYC 7763
Settings
- Runtime
- Rust 1.99.1 (release build, thin LTO)
- Server
- loco start (Axum/Hyper), LOCO_ENV=production
- Workers
- Tokio multi-threaded runtime, one worker per available CPU (2)
- Database layer
- SeaORM 2.0 (find_by_id, ActiveModel::update, Entity::find().all), pool max_connections = DB_POOL_SIZE
- Templates
- Tera 2 (Loco TeraView)
- Logging
- none per request (logger middleware off in config/production.yaml); application logger at warn
- Dependency source
- –
- Status
- measured
Application endpoints: mechanisms
- Validation
- Loco's QueryValidate, JsonValidate and FormValidate extractors (validator 0.20: 400; Axum's Json data errors 422, Form parse errors 422); Path<i32> (400)
- CSRF
- token (library): axum_csrf 0.12 layer on /form and /login (token in an encrypted cookie, HMAC in the form field)
- Session store
- cookie-signed (built-in): Loco auth_session feature, default cookie store (Session, CurrentUser<users::Model>)
Tier 1 endpoints
| Endpoint | req/s | vs Axum | Efficiency (req/CPU-s) | p99 (ms) | Errors | Limits |
|---|---|---|---|---|---|---|
| /text | 88,625 (55,554–143,618) | 0.51 | 44,494 | 2.09 | 0 | |
| /json | 88,666 (55,748–142,278) | 0.51 | 44,458 | 2.08 | 0 | |
| /db-single | 18,169 (12,096–34,989) | 0.99 | 10,392 | 8.74 | 0 | PostgreSQL-bound 15/15 |
| /html | 77,291 (49,599–133,180) | 0.48 | 38,730 | 2.40 | 0 | |
| /queries?queries=20 | 1,090 (730–2,082) | 0.99 | 771 | 131.54 | 0 | PostgreSQL-bound 15/15 |
| /fortunes | 17,005 (10,841–24,248) | 0.58 | 8,633 | 8.30 | 0 | |
| GET /world/{id} | 17,168 (11,017–33,108) | 0.98 | 10,363 | 9.77 | 0 | PostgreSQL-bound 15/15 |
| GET /worlds | 13,610 (8,638–22,758) | 0.99 | 8,838 | 12.22 | 0 | PostgreSQL-bound 15/15 |
| POST /form | 48,498 (33,153–92,344) | 0.64 | 24,281 | 3.74 | 0 | |
| GET /me | 17,193 (10,875–29,893) | 1.77 | 9,343 | 11.25 | 0 | PostgreSQL-bound 15/15 |
| /updates?queries=20 | 458 (297–880) | 0.93 | 381 | 287.59 | 0 | PostgreSQL-bound 15/15 |
| PUT /world/{id} | 8,403 (5,537–15,982) | 0.59 | 5,685 | 18.42 | 0 | PostgreSQL-bound 15/15 |
Measured versions
axum0.8.9axum_csrf0.12.0hyper1.12.0loco-rs1.3.1sea-orm2.0.4sqlx0.9.0tera2.4.0tokio1.54.1validator0.20.0
Runner jobs
| Job | CPU model | Rounds | Status |
|---|---|---|---|
| 1 | Xeon 6975P-C | 5 | measured |
| 2 | EPYC 9V74 | 5 | measured |
| 3 | EPYC 7763 | 5 | measured |