Accumulate on-CPU cycles per actor as ActorInfo.budget_cycles, behind the off-by-default budget-accounting feature (D6) — a reductions-style work metric for relative comparison across runs. - Approximate by design (per Mark): charge now - slice-start once at the yield point, reusing the timestamp reset_timeslice already sets, so one RDTSC per resume not two. Wake-slot resumes inherit the slice and so slightly over-attribute the chain's time to the woken actor — noise that averages out; we trade exactness for half the hot-path cost. - Field/ActorInfo member are unconditional (keeps the snapshot shape stable across the feature flag, D1); only the accumulation is gated, so default builds are byte-identical and pay nothing. Reads return 0 when off. Single-writer Relaxed like the other counters; reset in reset_counters (D7). Matrix: default + feature-on + rq-mpmc + rq-striped + release + trace all green; loom unaffected (feature off under --cfg loom).
73 lines
1.3 KiB
TOML
73 lines
1.3 KiB
TOML
[package]
|
|
name = "smarm"
|
|
version = "0.4.0"
|
|
edition = "2021"
|
|
rust-version = "1.95"
|
|
|
|
[lints.rust]
|
|
unexpected_cfgs = { level = "warn", check-cfg = ["cfg(loom)"] }
|
|
|
|
[features]
|
|
default = ["rq-mutex"]
|
|
smarm-trace = []
|
|
# RFC 016 Chunk 2: cycle-accurate per-actor time-budget accounting. Off by
|
|
# default — it costs two extra RDTSC reads per actor resume on the hot path
|
|
# (D6). The `ActorInfo.budget_cycles` field exists regardless; it just stays 0
|
|
# unless this is enabled.
|
|
budget-accounting = []
|
|
# Run-queue selection: exactly one, compile-time (see src/run_queue.rs).
|
|
# Non-default variants need --no-default-features (features are additive).
|
|
rq-mutex = []
|
|
rq-mpmc = []
|
|
rq-striped = []
|
|
|
|
[dependencies]
|
|
libc = "0.2"
|
|
|
|
[target.'cfg(loom)'.dependencies]
|
|
loom = "0.7"
|
|
|
|
[dev-dependencies]
|
|
libc = "0.2"
|
|
tokio = { version = "1", features = ["rt", "rt-multi-thread", "macros", "sync", "time"] }
|
|
|
|
[profile.dev]
|
|
panic = "unwind"
|
|
|
|
[profile.release]
|
|
panic = "unwind"
|
|
lto = "thin"
|
|
codegen-units = 1
|
|
|
|
[[bench]]
|
|
name = "primes"
|
|
harness = false
|
|
|
|
[[bench]]
|
|
name = "multi_scheduler"
|
|
harness = false
|
|
|
|
[[bench]]
|
|
name = "general"
|
|
harness = false
|
|
|
|
[[bench]]
|
|
name = "smarm_favored"
|
|
harness = false
|
|
|
|
[[bench]]
|
|
name = "tokio_favored"
|
|
harness = false
|
|
|
|
[[bench]]
|
|
name = "rq_micro"
|
|
harness = false
|
|
|
|
[[bench]]
|
|
name = "rq_runtime"
|
|
harness = false
|
|
|
|
[[bench]]
|
|
name = "switch_cost"
|
|
harness = false
|