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 dataclasses import dataclass, field
from datetime import date, datetime
from decimal import Decimal
@@ -150,3 +151,19 @@ class SelectionUniverseReader(Protocol):
) -> SelectionExecutionSource: ...
def load_history(self, ts_code: str, target_trade_date: date) -> StockHistory: ...
class BatchSelectionRunStore(Protocol):
"""Optional batch-write extension for selection stores."""
def record_items(self, run_id: str, items: Sequence[SelectionRunItem]) -> None: ...
class BatchSelectionUniverseReader(Protocol):
"""Optional bounded batch-history extension for selection readers."""
def load_histories(
self,
stocks: Sequence[SelectionStock],
target_trade_date: date,
) -> tuple[StockHistory, ...]: ...