examples/causal_bench.rs (required-features smarm-causal): the Phase 2
RFC 007 test case — a real urus server replacing the synthetic demo as
validation workload.
Shape: 16 plain-OS-thread clients hammer GET /order/:id over blocking
loopback keep-alive TCP (OS threads can't absorb injected virtual delay
— the established trick, so only server code is delayable). The handler
calls a single store actor (crud's once-cell pattern, serialization
structural) burning 400µs of calibrated *work* under
causal_site!("store") — work-shaped, not timed, or injection reads as a
no-op. 50µs handler render lands under the enclosing pipeline site.
Known answer: store serialized + saturated => ceiling 2500 rps; speedup
p => x1/(1-p): +33% @25, +100% @50. The five lib sites are tens of µs
and parallel across conns => ~0. Verdict mirrors the demo: store @25 >
+15%, others < +10%, SKIPPED under 4 cores; magnitudes trusted to ~±15%
per the smarm-side validation notes, ranking is the hard check.
1-core sandbox smoke (verdict SKIPPED but numbers indicative): store
+26.2% @25 / +74.0% @50, all other sites within ±2%. Unlike the demo
this workload keeps its bottleneck structure on one core — everything
but the store is IO-parked — and the theory shortfall there is plain
core contention (render/parse share the store's CPU), which the 24-core
sweep should close.
49 lines
1.1 KiB
TOML
49 lines
1.1 KiB
TOML
[package]
|
|
name = "urus"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
rust-version = "1.95"
|
|
description = "Cowboy/bandit-style HTTP library for the smarm actor runtime"
|
|
|
|
[dependencies]
|
|
smarm = { path = "../smarm" }
|
|
httparse = "1.9"
|
|
libc = "0.2"
|
|
sha1_smol = "1"
|
|
|
|
# dep #4, ratified 2026-06-12: serde/serde_json behind the opt-in
|
|
# "phoenix" feature only — the "channels" core stays dependency-free.
|
|
serde = { version = "1", optional = true }
|
|
serde_json = { version = "1", optional = true }
|
|
|
|
[features]
|
|
smarm-trace = ["smarm/smarm-trace"]
|
|
smarm-causal = ["smarm/smarm-causal"]
|
|
channels = []
|
|
phoenix = ["channels", "dep:serde", "dep:serde_json"]
|
|
|
|
[dev-dependencies]
|
|
serde = { version = "1", features = ["derive"] }
|
|
serde_json = "1"
|
|
|
|
[[example]]
|
|
name = "causal_bench"
|
|
required-features = ["smarm-causal"]
|
|
|
|
[profile.dev]
|
|
panic = "unwind"
|
|
|
|
[profile.release]
|
|
panic = "unwind"
|
|
lto = "thin"
|
|
codegen-units = 1
|
|
|
|
[[example]]
|
|
name = "crud"
|
|
path = "examples/crud.rs"
|
|
|
|
[[example]]
|
|
name = "channels_chat"
|
|
path = "examples/channels_chat.rs"
|
|
required-features = ["phoenix"]
|