-
-
Notifications
You must be signed in to change notification settings - Fork 81
Expand file tree
/
Copy pathCargo.toml
More file actions
88 lines (81 loc) · 3.16 KB
/
Copy pathCargo.toml
File metadata and controls
88 lines (81 loc) · 3.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
[package]
name = "django-bolt"
version = "0.10.0-alpha2"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
name = "django_bolt"
# rlib alongside cdylib so `cargo test` / `cargo bench` (criterion) can link
# against the crate. Wheels still build the cdylib via maturin.
crate-type = ["cdylib", "rlib"]
[features]
default = ["mimalloc"]
# Memory allocator options (mutually exclusive - mimalloc is default)
# Use jemalloc for sustained loads with lower fragmentation
# Use mimalloc for short-lived objects (often faster)
jemalloc = ["dep:tikv-jemallocator"]
mimalloc = ["dep:mimalloc"]
[dependencies]
# NOTE: "extension-module" is NOT hardcoded here — maturin enables it via
# pyproject.toml's [tool.maturin] features. This lets `cargo test`/`cargo bench`
# link libpython normally for native tests and criterion benches.
pyo3 = { version = "0.29", features = ["abi3-py312", "chrono"] }
pyo3-async-runtimes = { version = "0.29", features = ["tokio-runtime"] }
actix-web = { version = "4", features = ["compress-gzip", "compress-brotli", "compress-zstd", "cookies"] }
actix-http = "3"
actix-web-actors = "4" # WebSocket support
actix = "0.13" # Actor framework for WebSocket
actix-files = "0.6"
tokio = { version = "1", features = ["full"] }
socket2 = { version = "0.6", features = ["all"] }
matchit = "0.9"
# Middleware dependencies
governor = "0.10" # Rate limiting
jsonwebtoken = { version = "10", features = ["aws_lc_rs"] } # JWT authentication
base64 = "0.22" # base64url token-segment decoding for the JWT validation loop
dashmap = "6" # Fast concurrent hashmap for rate limiting
parking_lot = "0.12" # Fast RwLock for shared state
serde = { version = "1", features = ["derive"] }
serde_json = "1"
ahash = "0.8"
# Memory allocators (optional features)
mimalloc = { version = "0.1", default-features = false, optional = true }
tikv-jemallocator = { version = "0.6", optional = true }
urlencoding = "2"
once_cell = "1"
futures-util = "0.3"
bytes = "1"
brotli = "8"
flate2 = "1"
zstd = "0.13"
regex = "1"
# Type coercion dependencies (for path/query param parsing)
chrono = { version = "0.4", features = ["serde"] }
rust_decimal = { version = "1", features = ["serde"] }
uuid = { version = "1", features = ["v4", "serde"] }
# Form parsing dependencies
actix-multipart = "0.7"
serde_urlencoded = "0.7"
tempfile = "3"
log = "0.4"
notify = "8"
ctrlc = "3"
libc = "0.2"
[dev-dependencies]
criterion = "0.5"
[[bench]]
name = "hot_path"
harness = false
[profile.release]
codegen-units = 1 # Better optimization (single codegen unit allows more inlining)
debug = false # No debug symbols in release
incremental = false # Disable incremental compilation for release
lto = "fat" # Full Link-Time Optimization (slower build, faster binary)
opt-level = 3 # Maximum optimization level
panic = "abort" # Smaller binary, no unwinding overhead
strip = true # Remove symbols from binary
# Profile for profiling (release with debug info)
[profile.profiling]
inherits = "release"
debug = true # Enable debug symbols for profiling
strip = false # Keep symbols for profilers