moonfire-nvr/server/Cargo.toml
Scott Lamb 2985214d87 reduce per-slice allocations
`slices::Slices::get_range` was too closely following the example of
`http_serve::Entity::get_range`:

The latter is once-per-request, so just boxing is low-cost and makes
sense to easily avoid monomorphization bloat when there are potentially
many types of entity streams in one program. In Moonfire, it's used with
different streams defined in the `moonfire_nvr::web::mp4`,
`moonfire_nvr::bundled_ui`, and `http_serve::file` modules. Putting them
all into a single boxless enum would be a pain. In particular, the last
one is not a nameable type today and would need more generic parameters
to implement the caller-demanded `Entity` definition.

The former is once-per-slice, there are tons of slices per request, and
it's easy to define a two-case enum right where it's needed. So the
trade-off is quite different.

Also fix up some out-of-date comments.
2025-03-07 18:54:41 -08:00

130 lines
4.2 KiB
TOML

[package]
name = "moonfire-nvr"
version = "0.0.0"
authors = ["Scott Lamb <slamb@slamb.org>"]
edition = "2021"
resolver = "2"
license-file = "../LICENSE.txt"
rust-version = "1.82"
publish = false
[features]
# The nightly feature is used within moonfire-nvr itself to gate the
# benchmarks. Also pass it along to crates that can benefit from it.
nightly = ["db/nightly"]
# The bundled feature aims to make a single executable file that is deployable,
# including statically linked libraries and embedded UI files.
bundled = ["rusqlite/bundled", "bundled-ui"]
bundled-ui = []
[workspace]
members = ["base", "db"]
[workspace.dependencies]
base64 = "0.22.0"
h264-reader = "0.8.0"
itertools = "0.12.0"
jiff = "0.1.8"
nix = "0.27.0"
pretty-hex = "0.4.0"
ring = "0.17.0"
rusqlite = "0.33.0"
tracing = { version = "0.1" }
tracing-core = "0.1.30"
tracing-futures = { version = "0.2.5", features = ["futures-03", "std-future"] }
tracing-log = "0.2"
tracing-subscriber = { version = "0.3.16" }
uuid = { version = "1.1.2", features = ["serde", "std", "v7", "fast-rng"] }
[dependencies]
base = { package = "moonfire-base", path = "base" }
base64 = { workspace = true }
blake3 = "1.0.0"
bpaf = { version = "0.9.15", features = ["autocomplete", "bright-color", "derive"]}
bytes = "1"
byteorder = "1.0"
cursive = { version = "0.21.1", default-features = false, features = ["termion-backend"] }
data-encoding = "2.7.0"
db = { package = "moonfire-db", path = "db" }
futures = "0.3"
h264-reader = { workspace = true }
http = "1.1.0"
http-serve = { version = "0.4.0-rc.1", features = ["dir"] }
hyper = { version = "1.4.1", features = ["http1", "server"] }
itertools = { workspace = true }
jiff = { workspace = true, features = ["tz-system"] }
libc = "0.2"
log = { version = "0.4" }
memchr = "2.0.2"
nix = { workspace = true, features = ["time", "user"] }
nom = "7.0.0"
password-hash = "0.5.0"
pretty-hex = { workspace = true }
protobuf = "3.0"
reffers = "0.7.0"
retina = "0.4.13"
ring = { workspace = true }
rusqlite = { workspace = true }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
smallvec = { version = "1.7", features = ["union"] }
tokio = { version = "1.24", features = ["macros", "rt-multi-thread", "signal", "sync", "time"] }
tokio-tungstenite = "0.26.1"
toml = "0.8"
tracing = { workspace = true, features = ["log"] }
tracing-subscriber = { version = "0.3.16", features = ["env-filter", "json"] }
tracing-core = "0.1.30"
tracing-futures = { version = "0.2.5", features = ["futures-03", "std-future"] }
tracing-log = { workspace = true }
url = "2.1.1"
uuid = { workspace = true }
flate2 = "1.0.26"
hyper-util = { version = "0.1.7", features = ["server-graceful", "tokio"] }
http-body = "1.0.1"
http-body-util = "0.1.2"
pin-project = "1.1.10"
[target.'cfg(target_os = "linux")'.dependencies]
libsystemd = "0.7.0"
[build-dependencies]
ahash = "0.8"
blake3 = "1.0.0"
walkdir = "2.3.3"
[dev-dependencies]
mp4 = { git = "https://github.com/scottlamb/mp4-rust", branch = "moonfire" }
num-rational = { version = "0.4.0", default-features = false, features = ["std"] }
reqwest = { version = "0.12.0", default-features = false, features = ["json"] }
tempfile = "3.2.0"
tracing-test = "0.2.4"
[profile.dev.package.scrypt]
# On an Intel i3-6100U @ 2.30 GHz, a single scrypt password hash takes 7.6
# seconds at opt-level=0, or 0.096 seconds at opt-level=2. Always optimize this
# crate to avoid seeming hung / being annoyingly slow when debugging.
opt-level = 2
[profile.release]
debug = 1
[profile.release-lto]
inherits = "release"
lto = true
[profile.bench]
debug = 1
[patch.crates-io]
# Override the `tracing` crate versions with a branch that updates the
# `matchers` dependency to avoid duplicate `regex-automata` crate versions.
# This branch is based on tracing's `0.1.x` branch with changes similar to
# <https://github.com/tokio-rs/tracing/pull/3033> applied.
tracing = { git = "https://github.com/scottlamb/tracing", rev = "861b443d7b2da400ca7b09111957f33c80135908" }
tracing-core = { git = "https://github.com/scottlamb/tracing", rev = "861b443d7b2da400ca7b09111957f33c80135908" }
tracing-log = { git = "https://github.com/scottlamb/tracing", rev = "861b443d7b2da400ca7b09111957f33c80135908" }
tracing-subscriber = { git = "https://github.com/scottlamb/tracing", rev = "861b443d7b2da400ca7b09111957f33c80135908" }