perf(selection): 优化选股执行性能

This commit is contained in:
yuxuanhui
2026-08-12 09:45:16 +08:00
parent dd04933d63
commit 8963c067b3
22 changed files with 1333 additions and 120 deletions
@@ -2,6 +2,7 @@
from __future__ import annotations
from collections.abc import Sequence
from datetime import date
from ..domain.models import SelectionEvaluation, StockHistory
@@ -44,3 +45,12 @@ class EvaluateZhixingB1:
"""Evaluate an already loaded history for deterministic unit tests."""
return self.strategy.evaluate(history, target_trade_date)
def execute_histories(
self,
histories: Sequence[StockHistory],
target_trade_date: date,
) -> tuple[SelectionEvaluation, ...]:
"""Evaluate loaded histories without issuing one read per stock."""
return tuple(self.execute_history(history, target_trade_date) for history in histories)