Implementation
Topcoat
Topcoat 0.12.1 · Rust · Rust · ranked
Scores
| Category | Position | Score | ± |
|---|---|---|---|
| Hello world | 2 | 0.77* | ±8.9% |
| Database | 1–2 | 1.15* | – |
| Application | 2 | 1.05* | ±5.8% |
| Memory (high-water mark) | 1–5 | 1.00≈ | ±0.4% |
| Startup | 1–13 | 1.00≈ | ±0.0% |
Runner CPUs: Xeon Platinum 8370C CPU @ 2.80GHz, EPYC 9V74, Xeon 6975P-C
Settings
- Runtime
- Rust 1.99.1 (release build, thin LTO)
- Server
- topcoat::start (Hyper)
- Workers
- Tokio multi-threaded runtime, one worker per available CPU (2)
- Database layer
- Toasty 0.11 (get_by_id, update(), all()), max_pool_size = DB_POOL_SIZE
- Templates
- view! macro
- Logging
- none (Topcoat logs nothing per request by default)
- Dependency source
- –
- Status
- measured
Notes
- Maturity: early 0.x framework, measured with its documented defaults
Application endpoints: mechanisms
- Validation
- path_param!(id: i32 else not_found) (404), #[query_params(error = bad_request)], content::Json and content::Form (400); ranges checked by hand (400)
- CSRF
- fetch-metadata (built-in): built-in OriginPolicy (Sec-Fetch-Site, then Origin against Host; 403), on by default for every unsafe request
- Session store
- postgresql (built-in): built-in session feature (token in a __Host- cookie via CookieLayer); token hash, user id and expiry in user_sessions, read with Toasty
Tier 1 endpoints
| Endpoint | req/s | vs Axum | Efficiency (req/CPU-s) | p99 (ms) | Errors | Limits |
|---|---|---|---|---|---|---|
| /text | 139,969 (123,805–222,141) | 0.79 | 70,568 | 1.33 | 0 | |
| /json | 136,896 (119,573–216,724) | 0.78 | 68,952 | 1.35 | 0 | |
| /db-single | 25,386 (23,304–49,585) | 1.40 | 13,525 | 5.80 | 0 | PostgreSQL-bound 15/15 |
| /html | 124,223 (122,811–201,347) | 0.75 | 62,536 | 1.50 | 0 | |
| /queries?queries=20 | 1,501 (1,449–3,408) | 1.42 | 912 | 86.44 | 0 | PostgreSQL-bound 15/15 |
| /fortunes | 24,306 (20,388–34,394) | 0.79 | 12,311 | 5.73 | 0 | |
| GET /world/{id} | 23,990 (22,686–47,180) | 1.38 | 13,056 | 6.43 | 0 | PostgreSQL-bound 15/15 |
| GET /worlds | 17,739 (14,859–28,989) | 1.27 | 9,539 | 9.28 | 0 | PostgreSQL-bound 15/15 |
| POST /form | 105,060 (89,719–173,332) | 1.19 | 52,840 | 1.77 | 0 | |
| GET /me | 13,192 (12,642–24,940) | 1.39 | 7,202 | 11.67 | 0 | PostgreSQL-bound 15/15 |
| /updates?queries=20 | 644 (623–1,499) | 1.38 | 428 | 197.88 | 0 | PostgreSQL-bound 15/15 |
| PUT /world/{id} | 11,841 (11,547–24,540) | 0.85 | 6,991 | 12.45 | 0 | PostgreSQL-bound 15/15 |
Measured versions
argon20.6.0hyper1.12.0toasty0.11.0toasty-driver-postgresql0.11.0tokio1.54.1topcoat0.12.1topcoat-cookie0.12.1topcoat-router0.12.1topcoat-session0.12.1topcoat-view0.12.1
Runner jobs
| Job | CPU model | Rounds | Status |
|---|---|---|---|
| 1 | Xeon Platinum 8370C CPU @ 2.80GHz | 5 | measured |
| 2 | EPYC 9V74 | 5 | measured |
| 3 | Xeon 6975P-C | 5 | measured |