-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathCargo.toml
More file actions
248 lines (194 loc) · 5.34 KB
/
Cargo.toml
File metadata and controls
248 lines (194 loc) · 5.34 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
[package]
name = "qaexchange-rs"
version = "0.1.0"
edition = "2021"
authors = ["@yutiansut"]
description = "High-performance quantitative exchange system built on QARS"
license = "MIT"
[features]
default = []
iceoryx2 = ["dep:iceoryx2"]
io_uring = ["dep:tokio-uring"]
simd = [] # SIMD 优化 (需要 nightly 或手动向量化)
otlp = [] # OpenTelemetry OTLP 导出器
[lib]
name = "qaexchange"
path = "src/lib.rs"
[[bin]]
name = "qaexchange-server"
path = "src/main.rs"
[dependencies]
# 核心依赖 - 复用 qars2 本地项目
qars = { path = "../qars2", package = "qa-rs" }
# Web 框架
actix = "0.13"
actix-web = "4.4"
actix-web-actors = "4.2"
actix-files = "0.6"
actix-cors = "0.7"
# 异步运行时
tokio = { version = "1.35", features = ["full"] }
futures = "0.3"
async-trait = "0.1"
# 并发数据结构
dashmap = "5.5"
parking_lot = "0.12"
crossbeam = { version = "0.8", features = ["crossbeam-channel"] }
rayon = "1.8"
# 序列化
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
serde-big-array = "0.5"
toml = "0.8"
# 零拷贝序列化(rkyv)
# 使用 size_64 以支持大型消息(>4GB),禁用默认特性避免与 size_32 冲突
# bytecheck: 运行时类型检查
rkyv = { version = "0.7", default-features = false, features = ["validation", "alloc", "size_64", "bytecheck", "std"] }
# 日期时间
chrono = "0.4"
time = "0.3" # rcgen 证书生成依赖
# 日志
log = "0.4"
env_logger = "0.11"
# 错误处理
thiserror = "1.0"
anyhow = "1.0"
# UUID
uuid = { version = "1.6", features = ["v4", "serde"] }
# 随机数生成
rand = "0.8"
# 密码加密
bcrypt = "0.15"
jsonwebtoken = "9.2"
# 数据库 (复用 qars 的连接)
mongodb = "2.7"
# clickhouse = { version = "0.11", features = ["tokio_io"] }
# 配置管理
config = "0.13"
# 指标监控
prometheus = "0.13"
lazy_static = "1.4"
# gRPC (with TLS support)
tonic = { version = "0.12", features = ["tls", "tls-roots", "tls-webpki-roots"] }
prost = "0.13"
# TLS 证书生成和管理 @yutiansut @quantaxis
rcgen = "0.13" # 自签证书生成
rustls = "0.23" # TLS 实现
rustls-pemfile = "2.2" # PEM 文件解析
tokio-rustls = "0.26" # Tokio TLS 集成
# OpenTelemetry 分布式追踪 @yutiansut @quantaxis
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] }
tracing-opentelemetry = "0.27"
opentelemetry = { version = "0.26", features = ["trace"] }
opentelemetry_sdk = { version = "0.26", features = ["rt-tokio"] }
opentelemetry-otlp = { version = "0.26", features = ["tonic"] }
opentelemetry-jaeger = { version = "0.22", features = ["rt-tokio"] }
# DSL解析
pest = "2.7"
pest_derive = "2.7"
# 高性能分配器
mimalloc = { version = "0.1", default-features = false }
# 延迟初始化
once_cell = "1.19"
# CPU 亲和性绑定
core_affinity = "0.8"
# 无锁 SPSC 队列
crossbeam-queue = "0.3"
# io_uring (Linux 5.1+)
tokio-uring = { version = "0.5", optional = true }
# 一致性哈希
hashring = "0.3"
# 存储相关
crc32fast = "1.5.0"
crossbeam-skiplist = "0.1.3"
arrow2 = { version = "0.18", features = ["io_parquet", "io_parquet_compression"] }
parquet2 = { version = "0.17", default-features = false } # 与 arrow2 版本匹配
memmap2 = "0.9" # mmap 零拷贝文件映射
zstd = "0.13" # ✨ ZSTD压缩,用于 factor state checkpoint @yutiansut @quantaxis
# 查询引擎
polars = { version = "0.51", features = ["lazy", "sql", "parquet", "dtype-full", "is_in"] }
# 零拷贝 IPC (可选)
iceoryx2 = { version = "0.4", optional = true } # 共享内存零拷贝通信
# gRPC 流式传输
tokio-stream = "0.1"
# 系统信息采集
sysinfo = "0.31"
[build-dependencies]
tonic-build = "0.12"
[dev-dependencies]
tokio-test = "0.4"
mockall = "0.12"
criterion = "0.5"
tempfile = "3.23.0"
reqwest = { version = "0.11", features = ["json"] }
tokio-tungstenite = "0.21"
futures-util = "0.3"
[profile.dev]
opt-level = 0
debug = true
[profile.release]
opt-level = 3
lto = "fat"
codegen-units = 1
panic = "abort"
strip = true
# 优化性能配置 (与 qars 保持一致)
[profile.opt-dev]
inherits = "dev"
opt-level = 2
debug = true
[profile.debug-release]
inherits = "release"
debug = true
strip = false
[profile.extreme]
inherits = "release"
opt-level = 3
lto = "fat"
codegen-units = 1
panic = "abort"
strip = true
[[example]]
name = "start_exchange"
path = "examples/start_exchange.rs"
[[example]]
name = "client_demo"
path = "examples/client_demo.rs"
[[example]]
name = "stress_test"
path = "examples/stress_test.rs"
[[example]]
name = "high_performance_demo"
path = "examples/high_performance_demo.rs"
[[example]]
name = "benchmark_million_orders"
path = "examples/benchmark_million_orders.rs"
[[example]]
name = "benchmark_storage_system"
path = "examples/benchmark_storage_system.rs"
[[example]]
name = "decoupled_storage_demo"
path = "examples/decoupled_storage_demo.rs"
[[example]]
name = "full_trading_demo"
path = "examples/full_trading_demo.rs"
[[example]]
name = "notification_demo"
path = "examples/notification_demo.rs"
[[example]]
name = "storage_integration_demo"
path = "examples/storage_integration_demo.rs"
[[example]]
name = "test_snapshot_generator"
path = "examples/test_snapshot_generator.rs"
[[bench]]
name = "oltp_storage_bench"
path = "benches/oltp_storage_bench.rs"
harness = false
[[bench]]
name = "notification_serialization"
path = "benches/notification_serialization.rs"
[[bench]]
name = "storage_bench"
path = "benches/storage_bench.rs"