chore: 新增项目规则文档、构建别名及忽略规则 添加 AGENTS.md 项目规则文件,涵盖语言与工具链、模块设计、 Git 提交规范及验证流程等内容。 变更要点: - .cargo/config.toml 新增 xtask 命令别名 - .gitignore 忽略运行时地图缓存、接收器配置文件、 构建锁文件及本地 docs/ 目录 - 新增 AGENTS.md 定义项目编码、提交与审查规则 ```
43 lines
1.3 KiB
Rust
43 lines
1.3 KiB
Rust
use realtime_core::Store;
|
|
use rid_shared::Observation;
|
|
use std::time::{Instant, SystemTime, UNIX_EPOCH};
|
|
|
|
fn main() {
|
|
let count: usize = std::env::args()
|
|
.nth(1)
|
|
.unwrap_or("10000".into())
|
|
.parse()
|
|
.expect("target count");
|
|
assert!((1..=100000).contains(&count));
|
|
let mut store = Store::new(count, count * 2, 30000, 1);
|
|
let start = Instant::now();
|
|
for sequence in 0..100 {
|
|
for id in 0..count {
|
|
store.apply(
|
|
Observation {
|
|
target_id: format!("SIM-{id}"),
|
|
receiver_id: "SIM".into(),
|
|
source_epoch: 1,
|
|
sequence,
|
|
longitude: 120.0 + id as f64 * 0.00001,
|
|
latitude: 30.0,
|
|
altitude_m: 100.0,
|
|
heading_deg: 90.0,
|
|
},
|
|
sequence,
|
|
);
|
|
}
|
|
}
|
|
let elapsed = start.elapsed();
|
|
let now = SystemTime::now()
|
|
.duration_since(UNIX_EPOCH)
|
|
.unwrap()
|
|
.as_millis();
|
|
println!(
|
|
"{{\"kind\":\"state-core-only-not-end-to-end\",\"targets\":{count},\"updates\":{},\"seconds\":{},\"updates_per_second\":{},\"measured_at_unix_ms\":{now}}}",
|
|
count * 100,
|
|
elapsed.as_secs_f64(),
|
|
count as f64 * 100.0 / elapsed.as_secs_f64()
|
|
);
|
|
}
|