perf(core): reuse aligned snapshots in universe scan

This commit is contained in:
boris
2026-08-28 08:31:40 +08:00
parent cb2319cd22
commit 096115bd94
@@ -8889,16 +8889,16 @@ impl PlatformExprStrategy {
if ctx.has_dynamic_universe() && !ctx.dynamic_universe_contains(&factor.symbol) { if ctx.has_dynamic_universe() && !ctx.dynamic_universe_contains(&factor.symbol) {
continue; continue;
} }
let snapshots = ctx.data.symbol_snapshots_by_id(date, symbol_id);
let synthetic_candidate; let synthetic_candidate;
let candidate = let candidate = if let Some(candidate) = snapshots.candidate {
if let Some(candidate) = ctx.data.candidate_by_symbol_id(date, symbol_id) {
candidate candidate
} else { } else {
synthetic_candidate = synthetic_candidate =
crate::data::missing_candidate_risk_state(date, &factor.symbol); crate::data::missing_candidate_risk_state(date, &factor.symbol);
&synthetic_candidate &synthetic_candidate
}; };
let Some(market) = ctx.data.market_by_symbol_id(date, symbol_id) else { let Some(market) = snapshots.market else {
continue; continue;
}; };
let (reject_from_universe, selection_decision) = if collect_risk_decisions { let (reject_from_universe, selection_decision) = if collect_risk_decisions {