fast-cache 0.1.0

Embedded-first thread-per-core in-memory cache with optional Redis-compatible server
Documentation
[package]
name = "fast-cache"
version.workspace = true
edition.workspace = true
authors.workspace = true
homepage.workspace = true
license.workspace = true
repository.workspace = true
rust-version.workspace = true
description = "Embedded-first thread-per-core in-memory cache with optional Redis-compatible server"
documentation = "https://docs.rs/fast-cache"
keywords = ["cache", "redis", "kv", "storage", "wal"]
categories = ["caching", "database-implementations"]
readme = "README.md"
autobins = false
autotests = false
autobenches = false
exclude = [
    "bench/**",
    "fuzz/**",
    "tests/**",
    "src/bin/bench_*.rs",
    ".DS_Store",
]

[features]
# The crate defaults to the embedded Rust API. The TCP server is available as
# an explicit feature for deployments that want Redis/FCNP network ingress.
default = ["embedded", "sharded"]
embedded = []
sharded = ["embedded"]
server = [
    "sharded",
    "dep:bytes-handoff",
    "dep:clap",
    "dep:flume",
    "dep:socket2",
    "dep:tracing-subscriber",
]
# Linux-only runtime for the TCP server. It uses bytes-handoff's monoio read
# adapter while monoio owns the socket driver and shard-local worker runtime.
# Plain `server` remains the portable tokio implementation.
monoio = ["server", "dep:monoio", "bytes-handoff?/monoio"]
cuda = ["sharded"]
telemetry = ["embedded"]
fast-point-map = []
# Benchmark-only comparison knob for the shared embedded store lock.
# Default builds use `rblock`; enabling this swaps those stripes to
# `parking_lot::RwLock` so cache-level lock behavior can be A/B measured.
shared-parking-lot-lock = []
# Benchmark-only comparison knob for the server/direct `EmbeddedStore` lock.
# Default builds keep `parking_lot::RwLock`; enabling this swaps shard locks to
# `rblock::RwLock` so the server path can be A/B measured.
embedded-read-biased-lock = []
# Opt into reviewed unsafe hot paths for maximum throughput. This enables
# direct single-worker lock bypass, unchecked flat-map indexing/comparison
# helpers, and raw response-buffer writes.
unsafe = []

[dependencies]
bytes = "1"
bytes-handoff = { version = "1.2.0", optional = true }
clap = { workspace = true, optional = true }
core_affinity = { workspace = true }
crc32fast = { workspace = true }
crossbeam-channel = { workspace = true }
crossbeam-utils = { workspace = true }
fast-telemetry = { workspace = true }
hashbrown = { workspace = true }
itoa = "1"
log = { workspace = true }
libc = { workspace = true }
lz4_flex = { workspace = true }
memchr = "2"
parking_lot = { workspace = true }
rblock = { workspace = true }
serde = { workspace = true }
smallvec = "1"
socket2 = { version = "0.5", features = ["all"], optional = true }
serde_json = { workspace = true }
thiserror = { workspace = true }
tokio = { workspace = true }
toml = { workspace = true }
tracing = { workspace = true }
tracing-subscriber = { workspace = true, optional = true }
xxhash-rust = { workspace = true }
zstd = { workspace = true }

[dev-dependencies]
tempfile = { workspace = true }

# Runtime-agnostic mpsc used by the tokio fanout acceptor. Monoio and tokio
# direct-shard workers bind their own shard-local listeners instead.
[dependencies.flume]
version = "0.11"
default-features = false
features = ["async"]
optional = true

# Linux-only monoio runtime, gated via FAST_CACHE_USE_MONOIO=1 at runtime.
[target.'cfg(target_os = "linux")'.dependencies]
monoio = { version = "0.2", optional = true }

[[bin]]
name = "fast-cache-server"
required-features = ["server"]